Re: NullPointerExceptions using CallableStatement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




davidgodf@xxxxxxxxx wrote:
Hi,

I have come across the following problem using the SQLServer 2000 JDBC
drivers. We need to execute a stored proc on SQLServer, from within a
J2SE app (Java 1.4). We are using a CallableStatement to execute the
stored proc, however, unless we turn on implicit transactions within
the SQL of the stored procedure, when I call
CallableStatement.getResultSet, a null pointer exception is thrown. If
I refactor the code to use a Statement class, and simply execute an SQL
string as if I were executing the stored proc from query analyzer, it
works without requiring implicit transactions.

Any suggestions? The reason for not wanting to have implicit
transactions turned on if that MSDTC seems to be failing often, which
is a seperate problem we're looking at!!

Show us the JDBC code that declares the statement, sets the parameters,
and executes it. Also indicate the exact line of code that produces an
NPE.
GetResultSet() is allowed to return null. I think I know how to help
you....

Joe Weinstein at BEA Systems

.



Relevant Pages

  • executing sproc
    ... establish a new Connection Cnct and open it successfully. ... Before I run the stored proc, I execute a SQL Select ... Dim lcsConnectionString As String ...
    (microsoft.public.data.ado)
  • Re: Optimizer chooses different plans
    ... All our Employee data is from the mainframe, but the mileage_rate table has no mainframe dependency. ... Anyway, still doesn't answer why the code ALWAYS uses the indexes when cut and pasted to QA, but not so when the stored proc is executed. ... > Analyzer and execute it, ... >> After we added the hints it worked for a while but now does table scans. ...
    (microsoft.public.sqlserver.server)
  • NullPointerExceptions using CallableStatement
    ... I have come across the following problem using the SQLServer 2000 JDBC ... We are using a CallableStatement to execute the ... stored proc, however, unless we turn on implicit transactions within ... works without requiring implicit transactions. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Empty Stored Proc takes 8ms to complete?
    ... An empty proc should take less than 1ms to execute end-to-end. ... SQL Server MVP ... We have a custom DLL written in C++ which calls an empty Stored Proc (through ...
    (microsoft.public.sqlserver.server)
  • Re: Problem with boolean return parameter of CallableStatement.exe
    ... JDBC driver with Java 1.5.0 06. ... Some of our code uses the execute method of a CallableStatement to get a result set and checks that the boolean return parameteris true before then processing that result set. ... Using the sybase jdbc driver 'true' is returned when there are any results, whereas with the sqljdbc driver a 'false' is being returned. ...
    (microsoft.public.sqlserver.jdbcdriver)