Re: NullPointerExceptions using CallableStatement



Ok, basically as follows;

CallableStatement stmt = conn.prepareCall("{Call MyStoredProc(?,?)}");

stmt.setString(1, null);
stmt.setString(2, "Test Value");
stmt.execute;

ResultSet rs = stmt.getResultSet();

if (rs.next()) {
System.out.println("RS1=" + rs.getString(1));
}

Unless implicit transactions are enabled in the stored proc SQL, this
code fails when rs.next is called. If I turn off implicit transactions
in the proc, and rather use a Statement class and directly execute the
sql, it works fine.

Much appreciate your help.


joeNOSPAM@xxxxxxx wrote:
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

.


Loading