Error with ExecuteQuery() in prepared statement

Hello,
i' m a new one at java. I' m trying to build a web application in jsp and i have a problem in a simple at log in authentication.
My code is this:
<html>
<head>
<title>Welcome to the online Boat Shop, Inc.</title></head>
<body>
<%@ page language ="java" import = "java.io.*, java.lang.*, java.sql.*" %>
<% try
String strUsername = request.getParameter("USERNAME");
String strPassword = request.getParameter("PASSWORD");
Class.forName ("org.apache.derby.jdbc.ClientDriver");
Connection myConn = DriverManager.getConnection("jdbc:derby://localhost:1527/boatsdb","tony", "logo");
String strSQL = "SELECT USERNAME, PASSWORD FROM BOATDB where USERNAME = ? and PASSWORD = ?";
PreparedStatement stmt = myConn.prepareStatement(strSQL);
stmt.setString(1, "USERNAME");
stmt.setString(2, "PASSWORD");
ResultSet myResult = stmt.executeQuery(strSQL);
if(myResult.next()){
out.println("Login Succesful! A record with the given user name and password exists");
} else {
out.println("Login Failed. No records exists with the given user name and password");
myResult.close();
stmt.close();
myConn.close();
} catch(Exception e){
out.println(e);
%>
</body>
</html>
The problem is that prepared statement doesn't support executeQuery() method and i can find any solution. The error is this:
java.sql.SQLException: Method 'executeQuery(String)' not allowed on prepared statement. I already have some data in my database so that it can return results.
Thank you.
Edited by: antonis on May 3, 2008 6:13 AM

thank you, that was the problem. It seems that i have also done mistakes in passing the username and password from the forms to the database for checking, because the message that i get always when i log is that there is no user with this username kai password.
<form method=GET action=log1.jsp>
<font size=5> Username <input type=text name="USERNAME" size=20>
          </font>
          <br>
          <font size=5> Password <input type=text name="PASSWORD" size=20>
          </font>
          <br>
          <input type=submit name=action value="Submit">
</form>
That's the forms and combined with the code in the fist post should have worked. Any ideas?
thanks again.

Similar Messages

  • Invalid cursor state error while executing the prepared statement

    hai friends,
    following code showing the invalid cursor state error while executing the second prepared statement.
    pls anyone help me
    String query = "select * from order_particulars where order_no=" + orderno + " order by sno";             psmt1 = conEntry.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);             rs1 = psmt1.executeQuery();             rs1.last();             intRowCount = rs1.getRow();             particularsdata = new Object[intRowCount][6];             rs1.beforeFirst();             if (intRowCount >= 1) {                 for (int i = 0; rs1.next(); i++) {                     particularsdata[0] = i + 1;
    particularsdata[i][1] = rs1.getString(3);
    particularsdata[i][2] = Double.parseDouble(rs1.getString(4));
    rs1.close();
    psmt1.close();
    query = "SELECT sum(delqty) FROM billdetails,billparticulars WHERE order_no= " + orderno + " and " +
    "billdetails.bill_no = billparticulars.bill_no GROUP BY particulars ORDER BY sno";
    psmt1 = conEntry.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    rs1 = psmt1.executeQuery(); //error showing while executing this line

    Also .. Why using arrays instead of collections? Shifting the cursor all the way forth and back to get the count is fairly terrible.
    With regard to the problem: either there's a nasty bug in the JDBC driver used, or you actually aren't running the compiled class version of the posted code.

  • SQL error with LIKE clause in statement

    Can anyone explain how an SQL statement with a LIKE clause is executed properly?
    Seems like it ought to be cut and dried, no pun intended!
    When I run the following and set the requestor name = ?, and correctly type in the entire name, a result set (albeit abbreviated) will return.
    But if I try to set the request param to LIKE I get an error of some kind, either invalid cursor state or NullPointer exception.
    Here's my code.
    Statement selstmt = connection.createStatement();          
    String preparedQuery = "SELECT DISTINCT AID, ACTIVE, REQUESTOR_NAME,REQUESTOR_EMAIL" +
    " FROM CHANGE_CONTROL_USER, CHANGE_CONTROL_ADMIN " +
    " WHERE REQUESTOR_NAME LIKE '%?%';";
      String reqName = request.getParameter("requestor_name");
    PreparedStatement prepstmt = connection.prepareStatement(preparedQuery);
    prepstmt.setString(1, reqName);
    ResultSet rslts = prepstmt.executeQuery();
    rslts.next();
    int aidn = rslts.getInt(1);          
    int actbox = rslts.getInt(2);      
    String reqname = rslts.getString(3);
    String reqemails = rslts.getString(4);It's also returning only 1 record for some reason, as I have the following:
    <% while (rslts.next()) { %>
      <tr class="style17">
        <td><%=reqname%></td>
    <td><%=reqemails%></td>
       <td><%=actbox %></td>
        <td><%=aidn %></td>
      </tr>
      <%
    rslts.close();
    selstmt.close();
    %>If I use
    " FROM CHANGE_CONTROL_USER, CHANGE_CONTROL_ADMIN " +
    " WHERE REQUESTOR_NAME = ?;";it will actually spit out the name and corresponding email properly, albeit just one record like I said.
    Is there some kind of escape sequence I should be using that I'm not?
    And why just the one record?
    Any help or direction is appreciated!
    Thanks.

    I have working code for LIKE in PreparedStatement, and its equivalent in your case is something like this:Statement selstmt = connection.createStatement();          
    String preparedQuery = "SELECT DISTINCT AID, ACTIVE, REQUESTOR_NAME,REQUESTOR_EMAIL" +
    " FROM CHANGE_CONTROL_USER, CHANGE_CONTROL_ADMIN " +
    " WHERE REQUESTOR_NAME LIKE ?";
      String reqName = request.getParameter("requestor_name");
    PreparedStatement prepstmt = connection.prepareStatement(preparedQuery);
    prepstmt.setString(1, "%" + reqName.trim() + "%");
    ResultSet rslts = prepstmt.executeQuery();
    rslts.next();
    int aidn = rslts.getInt(1);          
    int actbox = rslts.getInt(2);      
    String reqname = rslts.getString(3);
    String reqemails = rslts.getString(4);

  • Re Creating  a chart getting an error with a 'Union All' statement

    Hi
    I have some data to chart with the following fields;
    Product , Jul-08 , Aug-08, Sep-08 etc ...... to Jan-10.
    The PRODUCT field is text showing the numerous Product Names
    The Jul-08 & other month fields have numbers per product that is to be aggregated for that month & plotted on the line graph.
    My SQL to create the first point on the chart is as below;
    select null link, PRODUCT label, SUM(JUL-08) "FFF"
    from "SCHEMANAME"."TABLENAME"
    WHERE PRODUCT = 'FFF'
    GROUP by PRODUCT
    ORDER BY PRODUCT
    This works fine until I want add the second point of this line graph using a 'union all' join as follows;
    select null link, PRODUCT label, SUM(JUL_08) "FFF"
    from "SCHEMANAME"."TABLENAME"
    WHERE PRODUCT = 'FFF'
    UNION ALL
    select null link, PRODUCT label, SUM(AUG_08) "FFF"
    from "SCHEMANAME"."TABLENAME"
    WHERE PRODUCT = 'FFF'
    I can't work out how I can join the other months on the line graph in one series.
    The error is as follows;
    1 error has occurred
    Failed to parse SQL query:
    select null link, PRODUCT label, SUM(OCT_09) "NCDS - STD" from "BI_A_DATA"."CDW_VS_NCDS_CALLS" WHERE PRODUCT = 'NCDS - STD' UNION ALL select null link, PRODUCT label, SUM(NOV_09) "NCDS - LOCAL" from "BI_A_DATA"."CDW_VS_NCDS_CALLS" WHERE PRODUCT = 'NCDS - LOCAL'
    ORA-00937: not a single-group group function
    Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
    Can anyone assist?
    I want a continuous Line Graph that shows all the months from Jul-08 , Aug-08, Sep-08 etc ...... to Jan-10 for the same product.
    I will then add other series for the other products, Thanks

    OK, I thought each month would be separated by the different months in each selct subquery, but I see what you mean.
    I'm creating a line graph for various PRODUCTS that has a numeric value for each month, from JUL_08 ..... for a number of months.
    I want a LINE graph that shows the different totals each month for that PRODUCT.
    The error advises that there are more values in the SELECT statement than the expected and to use Use the following syntax:
    SELECT LINK, LABEL, VALUE
    FROM ...
    I then went on to use the '[ ]' brackets to separate data but this didn't fix the problem.
    I've changed the script to suit as per your 'PERIOD' addition but now have the error as per below;
    error script
    1 error has occurred
    Invalid chart query: SELECT null link, PRODUCT label, PERIOD, SUM(ABC) FROM (SELECT null link, PRODUCT, 'JUL_08' PERIOD,SUM(JUL_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT UNION ALL SELECT null link, PRODUCT, 'AUG_08' PERIOD,SUM(AUG_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT UNION ALL SELECT null link, PRODUCT, 'SEP_08' PERIOD,SUM(SEP_08)ABC FROM BI_A_DATA.APEX_TEST WHERE PRODUCT = 'ABC' GROUP BY PRODUCT) GROUP BY link, PRODUCT, PERIOD
    Use the following syntax:
    SELECT LINK, LABEL, VALUE
    FROM ...
    Or use the following syntax for a query returning multiple series:
    SELECT LINK, LABEL, VALUE1 [, VALUE2 [, VALUE3...]]
    FROM ...
    LINK URL
    LABEL Text that displays along a chart axis.
    VALUE1, VALUE2, VALUE3... Numeric columns that define the data values.
    Note: The series names for Column and Line charts are derived from the column aliases used in the query.
    My script amended;
    SELECT null link, PRODUCT label, PERIOD, SUM(ABC)
    FROM
    (SELECT null link, PRODUCT, 'JUL_08' PERIOD,SUM(JUL_08)ABC
    FROM BI_A_DATA.APEX_TEST
    WHERE PRODUCT = 'ABC'
    GROUP BY PRODUCT
    UNION ALL
    SELECT null link, PRODUCT, 'AUG_08' PERIOD,SUM(AUG_08)ABC
    FROM BI_A_DATA.APEX_TEST
    WHERE PRODUCT = 'ABC'
    GROUP BY PRODUCT
    UNION ALL
    SELECT null link, PRODUCT, 'SEP_08' PERIOD,SUM(SEP_08)ABC
    FROM BI_A_DATA.APEX_TEST
    WHERE PRODUCT = 'ABC'
    GROUP BY PRODUCT)
    GROUP BY link, PRODUCT, PERIOD

  • "catch is unreachable" compiler error with java try/catch statement

    I'm receiving a compiler error, "catch is unreachable", with the following code. I'm calling a method, SendMail(), which can throw two possible exceptions. I thought that the catch statements executed in order, and the first one that is caught will execute? Is their a change with J2SE 1.5 compiler? I don't want to use a generic Exception, because I want to handle the specific exceptions. Any suggestions how to fix? Thanks
    try {
    SendMail(....);
    } catch (MessagingException e1) {
    logger.fine(e1.toString());
    } catch (AddressException e2) {
    logger.fine(e2.toString());
    public String SendMail(....) throws AddressException,
    MessagingException {....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I found the problem:
    "A catch block handles exceptions that match its exception type (parameter) and exception types that are subclasses of its exception type (parameter). Only the first catch block that handles a particular exception type will execute, so the most specific exception type should come first. You may get a catch is unreachable syntax error if your catch blocks do not follow this order."
    If I switch the order of the catch exceptions the compiler error goes away.
    thanks

  • Boolean error with a If else statement

    Hello, i am new to java, and the only other programing language i have used is pascal, and compared to java its ALOT different any ways my problem. I am trying to write a simply little program which random selects a number between 1 and 10, i did that fine got to show that on screen with no probelm . Next i wanted to but in a if else statement, depending which numbers was selected it would show a different message this is where i am getting a probelm, here is the code for the whole thing:
    // randomColour
    import javax.swing.JOptionPane;
    public class randomColour {
      public static void main ( String args [])
        int value;
         value = 1 + ( int ) ( Math.random() * 10 );
            if (value = "1" )
             System.out.println("Green");
               else
                System.out.println("Blue");
              System.exit( 0 );
       } // end mainWhen i try to Compile it comes up with error saying required:boolean why is this? and what can i do to change to fix it?

    A single = is used to indicate assignment. You are testing for equality which requires ==. Also, "1" is a String. Value is an int. Changeif value = "1" to if value == 1Mark

  • Compilation error with simple if-else statement

    package chapterFive;
    * Author: Sarab
    * Filename: MainClass.java
    * Purpose: Try and get my mind around the concept of the selection
    * control structures and repetition statements
    class MainClass {
         public static void main(String [] args)
              // some variables and prompt for input
              java.util.Scanner scan = new java.util.Scanner(System.in);
              System.out.print("Please enter your name: ");
              String input = scan.nextLine();
              // some repetition statement, for loop
              if (input.equals("Sarab"));
                   System.out.println("Welcome Sarab!");
              else
                   System.out.println("You are in the else statement");
                   for(int sentinelValue; sentinelValue<5; sentinelValue++)
                        System.out.println("The following is the numbers 0-4"
                                  + " printed on separate lines: " + sentinelValue);
              System.out.println("This line will print regardless of whether you"
                        + " entered the if or the else portion of the selection"
                        + " statement.");
    }I am getting the following error:
    Exception in thread "main" java.lang.Error: Unresolved compilation problem:
         Syntax error on token "else", delete this token
         at chapterFive.MainClass.main(MainClass.java:26)What's the matter? This looked straight forward enough to me.

    if (input.equals("Sarab"));
    // is the same as
    if (input.equals("Sarab")) {}
    // so what you have amounts to this:
    if (input.equals("Sarab")) {}
      System.out.println("Welcome Sarab!");
    else { ... }You've got an if block that does nothing, then a block that always executes, calling println, and then your else. Since you have that block between if and else, the if has ended and it's not legal to use else.
    Get rid of the semicolon after if.

  • Could not find prepared statement with handle %.

    Greetings. I've seen several posts for this error on the web, but no clear cut answers. I captured the code below in profiler, with the intention of replaying in mgmt studio.
    However, the attempt end in the following error: "Could not find prepared statement with handle 612."
    declare @p1 int
    set @p1=612
    declare @p2 int
    set @p2=0
    declare @p7 int
    set @p7=0
    exec sp_cursorprepexec @p1 output,@p2 output,N'@P0 int,@P1 int,@P2 int,@P3 int,@P4 bit',N'EXEC dbo.mySproc @P0,@P1,@P2,@P3,@P4 ',4112,8193,@p7 output,219717,95,NULL,1,0
    select @p1, @p2, @p7
    Something noteworthy is that my sproc only has 5 input parameters, but this makes it look like it has many more.
    How do I manipulate the code enough to make it work in mgmt studio? Thanks!
    TIA, ChrisRDBA

    In profiler you would normally see RPC:Starting and RPC:Completed. The statement shown in RPC staring is what you need to pick because as Erland explained, completed would show "funky" behavior.
    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Oracle Prepared Statement and spaces in field

    I have a field that is defined as char(10). It has characters like '39' in it. When I select against it using standard SQL (where clause) I get results. When I use it in the where clause of a prepared statement it does not return any rows.
    If I have the field defined as char(2) the prepared statement works.
    If I have the field defined as varchar2(10) and loaded with '39' the prepared statement works.
    If I have the field defined as varchar2(10) and loaded with '39 ' the prepared statement returns no results.
    I really do not think this is a JDBC problem. However, since Oracle's site basically <expletive deleted>, I am hoping someone here has a solution.
    Thanks in advance if you can help.

    Let me clarify.
    I cannot remove the whitespace from the data in the database. I do not need the whitespace to do the query if I am not using a Prepared Statement. This seems to be a problem with the way Oracle is handling the prepared statement. (hence.. my thinking that this is really not a JDBC problem at all.. but I could be wrong.)

  • I am using apple configerator. I am unable to prepare or supervise 1 ipad. After preparing, I get an error that says "refresh completed but with an error, unable to verify supervision state" . I have erased all content and set up as a new ipad.

    I am using apple configerator. I am unable to prepare or supervise 1 ipad. After preparing, I get an error that says "refresh completed but with an error, unable to verify supervision state" . I have erased all content and set up as a new ipad and tried again with no success. Any help would be appreciated

    Hello jaybearden,
    Thanks for the question. After reviewing your post, it sounds like you are not able to restore the iOS device since you get an error 9. I would recommend that you read this article, it may be able to help the issue.
    Resolve iOS update and restore errors - Apple Support
    Check your security software
    Related errors: 2, 4, 6, 9, 1000, 1611, 9006. Sometimes security software can prevent your device from communicating with either the Apple update server or with your device.
    Check your security software and settings to make sure that they aren't preventing a connection to the Apple servers.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Error 01006 with prepared statement

    I have the 1006 error with the statement:
    prepstmt = conn.prepareStatement
    select col from table where col = '?'
    The parameter is set with setString().
    I tried with the oracle 815 and 817 drivers.

    where i've to put STATEMENT.RETURN_GENERATED_KEYS?
    I need to use executeUpdate()...I didn't put it anywhere. I just called the getGeneratedKeys() method without using that constant anywhere and it just worked.

  • Help with streaming result sets and prepared statements

    hi all
    I create a callable statement that is capable of streaming.
    statement = myConn2.prepareCall("{call graphProc(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}",java.sql.ResultSet.TYPE_FORWARD_ONLY,
    java.sql.ResultSet.CONCUR_READ_ONLY);
    statementOne.setFetchSize(Integer.MIN_VALUE);
    the class that contains the query is instantiated 6 times the first class streams the results beautifully and then when the second
    rs = DatabaseConnect.statementOne.executeQuery();
    is executed I get the following error
    java.sql.SQLException: Can not use streaming results with multiple result statements
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
    at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1370)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1688)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:3031)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:943)
    at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1049)
    at com.mysql.jdbc.CallableStatement.executeQuery(CallableStatement.java:589)
    the 6 instances are not threaded and the result set is closed before the next query executes is there a solution to this problem it would be greatly appreciated
    thanks a lot
    Brian

    Database resources should have the narrowed scope
    possible. I don't think it's a good idea to use a
    ResultSet in a UI to generate a graph. Load the data
    into an object or data structure inside the method
    that's doing the query and close the ResultSet in a
    finally block. Use the data structure to generate
    the graph.
    It's an example of MVC and layering.
    Ok that is my bad for not elaborating on the finer points sorry, the results are not directly streamed into the graphs from the result set. and are processed in another object and then plotted from there.
    with regards to your statement in the beginning I would like to ask if you think it at least a viable option to create six connections. with that said would you be able to give estimated users using the six connections under full usage.
    just a few thoughts that I want to
    bounce off you if you don't mind. Closing the
    statement would defeat the object of of having a
    callable statement How so? I don't agree with that.
    %again I apologise I assumed that since callable statements inherit from prepared statements that they would have the pre compiled sql statement functionality of prepared statements,well If you consider in the example I'm about to give maybe you will see my point at least with regards to this.
    The statement that I create uses a connection and is created statically at the start of the program, every time I make a call the same statement and thus connection is used, creating a new connection each time takes up time and resources. and as you know every second counts
    thanks for your thoughts
    Brian.

  • Ingres prepared statement error

    Hi there,
    I 'm encountering a very strange problem with a prepared statement and ingres.
    String strSQL = "select first 50 date_part('year', dtrans_date) as year, ccalled_place as place, "  +
    "count(*) as calls, " +
    "sum(nduration/60.0) as duration " +
    "from phone " +
    "where date_part('year', dtrans_date) = ? and cDest_type='C' " +
    "group by date_part('year', dtrans_date), ccalled_place " +
    "order by date_part('year', dtrans_date), calls desc";
    PreparedStatement ps = conn.prepareStatement(strSQL);          
    ps.setInt(1, 2000);
    rs = ps.executeQuery();It throws the exception:
    ca.gcf.util.SqlEx: An internal error prevents further processing of this query.
    Associated error messages which provide more detailed information about the problem can be found in the error log, II_CONFIG:errlog.log
         at ca.gcf.jdbc.DrvObj.readError(DrvObj.java:773)
         at ca.gcf.jdbc.DrvObj.readResults(DrvObj.java:629)
         at ca.gcf.jdbc.DrvPrep.<init>(DrvPrep.java:137)
         at ca.gcf.jdbc.DrvConn.getPrepStmt(DrvConn.java:786)
         at ca.gcf.jdbc.JdbcPrep.<init>(JdbcPrep.java:364)
         at ca.gcf.jdbc.JdbcConn.createPrep(JdbcConn.java:1550)
         at ca.gcf.jdbc.JdbcConn.prepareStatement(JdbcConn.java:1380)
         at TestIngresDB.query(TestIngresDB.java:37)
         at TestIngresDB.<init>(TestIngresDB.java:9)
         at TestIngresDB.main(TestIngresDB.java:55)This is exactly at the line:
    ps = conn.prepareStatement(strSQL);Checking Ingres' error log:
    FREEFALL: 32867             , 12f678e0]: Thu Dec  2 07:01:57 2004 E_SC0207_UNEXPECTED_ERROR    Facility returned an undocumented error.
    FREEFALL: 32867             , 12f678e0]: ULE_FORMAT: Couldn't look up message 0 (reason: ER error 10902)
    E_CL0902_ER_NOT_FOUND   No text found for message identifier
    FREEFALL: 32867             , 12f678e0]: Thu Dec  2 07:01:57 2004 E_SC0215_PSF_ERROR   Error reHowever, other prepared statements like this work fine, e.g.:
    String sqlStr = "SELECT * FROM Stock WHERE Item_Number = ?";
    PreparedStatement pstmt = con.prepareStatement(query);
    pstmt.setInt(1, 2);
    ResultSet rs = pstmt.executeQuery();Sorry if this posting is not appropriate here, but I really don't know if this has something to do with JDBC or Ingres driver itself. Note that the query runs perfectly ok when run from Ingres VisualDBA.
    Thanks,
    John.

    Your prepared statement looks like
    select first 50 date_part('year', dtrans_date) as year, ccalled_place as place, count(*) as calls, sum(nduration/60.0) as duration from phone where date_part('year', dtrans_date) = ? and cDest_type='C' group by date_part('year', dtrans_date), ccalled_place order by date_part('year', dtrans_date), calls desc
    I am not sure what this "first 50" is for?
    ***Annie***

  • DAG - Backup failing on 1 DB only with error - The Microsoft Exchange Replication service VSS Writer instance ID failed with error code 80070020 when preparing for a backup of database 'DB012'

    Hi Board,
    i´ve search across the board, technet and symantec sites but did not found a hint about my problem.
    we drive a 2 node DAG (Location1-Ex1-mb1 
    Location2-exc1-mb1), on SP2 RU4 patchlevel with 40 Databases.
    Since some time the backup of one - and only one DB - is failing with these events, logged on the Mailboxserver on which the passive DB is hosted.
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:          28.09.2012 00:37:17
    Event ID:      2112
    Task Category: Exchange VSS Writer
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      Location1-Exc1-MB1
    Description: The Microsoft Exchange Replication service VSS Writer instance 1ab7d204-609a-4aea-b0a7-70afb0db38de failed with error code 80070020 when preparing for a backup of database 'DB012'.
    Followed by
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:         
    01.10.2012 03:33:06
    Event ID:      2024
    Task Category: Exchange VSS Writer
    Level:         Error
    Keywords:      Classic
    User:         
    N/A
    Computer:      Location1-Exc1-MB1
    Description:
    The Microsoft Exchange Replication service VSS Writer (Instance 42916d80-36c1-4f73-86d0-596d30226349) failed with error 80070020 when preparing for a backup.
    The backup Application - Symantec Backup Exec 2010 R3 – states, this error
    Snapshot provider error (0xE000FED1): A failure occurred querying the Writer status.
    Check the Windows Event Viewer for details.
    Writer Name: Exchange Server, Writer ID: {76FE1AC4-15F7-4BCD-987E-8E1ACB462FB7}, Last error: The VSS Writer failed, but the operation can be retried (0x800423f3), State: Stable (1).
    Symatec suggests within http://www.symantec.com/business/support/index?page=content&id=TECH184095
    to restart the MS Exchange Replication Service – BUT the mentioned eventID
    8229 isn´t present on any of the both Mailboxservers.
    The affected Database is active on Location2-Exc1-Mb1 Server and in an overall healthy state. I found during my research, that below Location2-Exc1-Mb1 Server, there are not removed shadow copies present!
    This confuses me, since all Backups are normally taken from the passive copy of a Database.
    So my questions to the board are:
    * Does anyone is facing similar issues?
    * Can someone explain why snapshots are present on the Mailboxserver hosting the Active Database, whilst the errors are logged on the passive one?
    -          * Does someone know the conditions, why shadows copies remain and
    aren´t removed in a proper manner?
    What can cause the circumstance, that only 1 DB is facing such issues?
    Any suggestion is welcome!
    BR
    Markus

    Hi Lenora,
    I´ve encreases VSS / Exchange Backup Log levels to expert, before starting
    those things i´ve all tried now:
    - Backup from passive DB (forced within Symantec Backup Exec)
    - Backup from active DB (forced within Symantec Backup Exec)
    - Backup from passive DB without GRT enabled (forced within Symantec Backup Exec)
    - Backup from active DB without GRT enabled(forced within Symantec Backup Exec)
    All those attempts failed.
    But brought some more details - the backup against the active DB states, that there is still a backup in progress and therefore this backup is cancelled by VSS.
    The Solution was, that i´ve needed to restart the Exchange Replication Service on the Mailbox Server hosting the passive DB.
    Backups are working again on all DBs!
    THX for your replys.
    Best regards
    Markus

  • Binding in Prepared Statement is not working with Microsoft SQL Server JDBC

    I ran the following program with sqljdbc4.jar in the class path. There is data in the EMPLOYEE table for the employee name DEMO but the following program is not retrieving data for DEMO. When the same program was run with Merlia.jar in the class path, it was retrieving data for DEMO.
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    Connection con = DriverManager.getConnection("jdbc:sqlserver://SERVER23:5000;databaseName=TESTDB", "SYSADM", "SYSADM");
    String sqlSele = "SELECT * FROM EMPLOYEE WHERE EMPNAME like ?" ;
    PreparedStatement sts = con.prepareStatement(sqlSele);
    sts.setString(1, "DEMO" );
    ResultSet rs = sts.executeQuery();
    while(rs.next())
    System.out.println("driverConn.main()" + rs.toString());
    catch(Exception e)
    System.out.println(e);
    e.printStackTrace();
    Can someone help me out from this issue.

    This is the program that I used for testing the behaviour of prepared statement with sqljdbc4.jar. Also included the code for Merlia.jar.
    import java.sql.*;
    public class driverConn {
         public static void main(String [] a)
              try{
              Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
              //Class.forName("com.inet.tds.TdsDriver");
              Connection con = DriverManager.getConnection("jdbc:sqlserver://SERVER23:5000;databaseName=TESTDB", "SYSADM", "SYSADM");
              //Connection con = DriverManager.getConnection("jdbc:inetdae7a:SERVER23:5000?database=TESTDB", "SYSADM", "SYSADM");
              String sqlSele = "SELECT * FROM EMPLOYEE WHERE EMPNAME like ?" ;
              //String sqlSele = "SELECT * FROM EMPLOYEE WHERE EMPNAME like ‘%DEMO%’”;
              PreparedStatement sts = con.prepareStatement(sqlSele);
              sts.setString(1, "DEMO" );
              //sts.setString(1, "%DEMO%" );          
              java.sql.ResultSet rs = sts.executeQuery();          
              while(rs.next())
                   System.out.println("EMPNAME is " + rs.getString(“EMPNAME”) + “”);                    }
              catch(Exception e)
                   System.out.println(e);
                   e.printStackTrace();
    Following are the specifications:
    Version of the Driver:
    Microsoft JDBC Driver 4.0 for SQL Server CTP3
    Downloaded the driver using the link http://www.microsoft.com/download/en/details.aspx?id=11774
    Java Version:
    Java 1.7.0_02
    Database Version:
    Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)

Maybe you are looking for

  • How To Fade In a JPG or GIF Image using Inspector Build-In or Action

    Inspector doesn't seem to have any Build-In or Action that allows me to FADE IN an image. There only seems to be an Opacity Action that allows a FADE OUT. This seems like kind of a software design oversight. Am I missing something in Keynote?

  • Can execute query be controlled for blocks

    Hi, I've 3 blocks in my form. The first and the second block are in query mode, therefore I cannot update, insert, delete values here. The third block, I have put on another canvas. So the moment there's data in the second block the third block gets

  • Script Error Loading Sony Media Software

    Hello! I have installed in my computer 2 plug-ins for my Sony Media Software (SoundForge & Vegas), I need to register them for use and everytime I try to register it, it opens me a Window telling about a Script Error: An Error has occurred in this sc

  • As a HUGE company, I am disappointed they can't handle International Travel Situations!

    I live in China and I am currently working on a Chinese computer (ugh).  I am trying to install Flash Player. So, I go to www.adobe.com and I click Flash Player and it sends me to Adobe - 安装其他版本的 Adobe Flash Player but I don't want Chinese, so I go b

  • Help!!!  isync won't open!

    The isync application, in the applications folder used to be a grey circle with rounded arrows inside. Now it looks like the default applications icon...what happened? I have a dot mac account and have that sync button on the menu bar, and it works f