Home Forums SQL Server 2005 Development Could not find prepared statement with handle xx RE: Could not find prepared statement with handle xx

  • It a Java app, although that is hidden from my interface, where I am writing just the SQL and submitting it. The full message I get is:

    sql: java.sql.SQLException: Could not find prepared statement with handle 1.

    ...but I don't get the java stack dump (maybe its hidden from my application).

    Not sure about the concurrent server user limit - it should be high.

    What is actually happening on SQL Server when I use (or at least the Java ODBC driver uses) prepared statements?

    I would guess that on first execution, the statement is prepared and executed. On subsequent executions, a handle is used to point to the prepared statement, and therefore only the execution actually takes place (instead of prepare & execute). Could anybody confirm that is how it should work?

    Thanks!