Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC execute statement with Brackets - NullPointerException

Re: JDBC execute statement with Brackets - NullPointerException

From: Olivier Guyot <olivier.guyot2_at_free.fr>
Date: Tue, 23 Jan 2007 12:37:28 +0100
Message-ID: <45b5f35e$0$31422$426a74cc@news.free.fr>


Hi,

I have tried whith OracleStatement, standard Statement and with all the three execute methods (execute, executeUpdate, executeQuery).

Result : KO all times with the same NullPointerException.

Other SQL statements (DDL) works fine, but creating an Oracle Java Stored Procedure fails every time.

Regs,

Olivier

joeNOSPAM_at_BEA.com a écrit :

> 
> On Jan 22, 2:19 pm, Olivier Guyot <olivier.guy..._at_free.fr> wrote:

>> Hi,
>>
>> I am trying to create Through JDBC Connection a Java Source Stored
>> procedure.
>>
>> I get a Null Pointer Exception on
>>
>> Statement.executeUpdate()
>>
>> aused by: java.lang.NullPointerException
>> at oracle.jdbc.driver.T4C8Oall.getNumRows(T4C8Oall.java:870)
>> at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:952)
>> at
>> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
>> at
>> oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1614)
>> at
>> oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1579)
>>
>> I found nothing on metalink, just a message on a post :
>>
>> http://www.minq.se/forum/thread.jspa?threadID=1518&tstart=60
>>
>> Telling that it is impossible to have statement whith {}. It is not well
>> interpreted (thinking { call PKG.FUNCTION }
>>
>> If somebody has an idea, telle me.
>>
>> Regs,
>>
>> Olivier
> 
> 
> Hi. Don't call executeUpdate() or executeQuery(), just call execute().
> Oracle can't return 'inline' result sets for executeQuery()'s mandated
> ResultSet return value, and executeUpdate() wants to return a row
> count of the number of rows affected by an update. Execute() will do
> everything, and afterwards you can process any returns.
> Joe Weinstein at BEA Systems
> 
Received on Tue Jan 23 2007 - 05:37:28 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US