Re: NullPointerExceptions using CallableStatement
- From: davidgodf@xxxxxxxxx
- Date: 21 Jul 2006 07:45:07 -0700
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
.
- Follow-Ups:
- Re: NullPointerExceptions using CallableStatement
- From: Joe Weinstein
- Re: NullPointerExceptions using CallableStatement
- References:
- NullPointerExceptions using CallableStatement
- From: davidgodf
- Re: NullPointerExceptions using CallableStatement
- From: joeNOSPAM@xxxxxxx
- NullPointerExceptions using CallableStatement
- Prev by Date: Re: NullPointerExceptions using CallableStatement
- Next by Date: Re: NullPointerExceptions using CallableStatement
- Previous by thread: Re: NullPointerExceptions using CallableStatement
- Next by thread: Re: NullPointerExceptions using CallableStatement
- Index(es):
Loading