RE: NullPointerException in CallableStatement of Sql server 2005 d

Tech-Archive recommends: Fix windows errors by optimizing your registry



Herlani,

Thanks for the reply. But our SP accepts 31 params and I am trying to
retrieve 30th one. Even if I am trying to retrieve an out of bound param,
driver code should not crash, it should give some error code with valid
explanation.

Also we are getting null pointer exceptions for many of our stored
procedures, but the stack trace is different from last one. (Actual code was
like call.getInt(2))

java.lang.NullPointerException
com.microsoft.sqlserver.jdbc.StreamRetValue.deserialize(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.indexOutParams(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getOutParameters(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getterGetParam(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getInt(Unknown Source)
com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement.getInt(WSJdbcCallableStatement.java:390)
com.xyz.SecurityDAO.logon(SecurityDAO.java:153)

Thanks,
Kotha.
"HERLANI JUNIOR" wrote:

Kotha,

Are you sure, that the call are you doing has 30 output parameters ?

Look the exception:
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.indexOutParams

Rgds,



"Kotha" wrote:

Hi,

I am getting the following null pointer with sql server 2005 driver.

java.lang.NullPointerException at
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.indexOutParams(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getOutParameters(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getterGetParam(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerCallableStatement.getInt(Unknown Source)
com.ibm.ws.rsadapter.jdbc.WSJdbcCallableStatement.getInt(WSJdbcCallableStatement.java:390)
com.xyz.dao.mssql.SearchDAO.searchItems(SearchDAO.java:718)
com.xyz.dao.mssql.SearchDAO.searchItems(SearchDAO.java:516)
com.xyz.ejb.finder.FinderEJBBean.searchItems(FinderEJBBean.java:182)
com.xyz.ejb.finder.EJSLocalStatelessFinderEJB_a98aa111.searchItems(EJSLocalStatelessFinderEJB_a98aa111.java:183)
com.xyz.ejb.workflow.WorkFlowEJBBean.searchItems(WorkFlowEJBBean.java:3087)
com.xyz.ejb.workflow.EJSRemoteStatelessWorkFlowEJB_36f544ce.searchItems(EJSRemoteStatelessWorkFlowEJB_36f544ce.java:2624)
com.xyz.ejb.workflow._WorkFlowEJBRemote_Stub.searchItems(_WorkFlowEJBRemote_Stub.java:2825)
com.xyz.web.delegate.BusinessDelegateImpl.searchItems(BusinessDelegateImpl.java:356)
com.xyz.web.actions.Action.newSearch(Action.java:3005)

My code is as follows.
int value = call.getInt(30); // EXCEPTION is coming here.

Configuration of my application :
I am using jdbc driver for sql server 2005 on weblogic/websphere

driver class : com.microsoft.sqlserver.jdbc.SQLServerXADataSource
data source helper class name in WSAD/RAD :
com.ibm.websphere.rsadapter.ConnectJDBCDataStoreHelper

Data source properties are as follows:

<property name="databaseName" value="pidbprod" />
<property name="serverName" value="pennsylvania" />
<property name="portNumber" value="1433" />
<property name="loginTimeout" value="" />
<property name="description" value="" />
<property name="enable2Phase" value="true" />
<property name="enableMultithreadedAccessDetection" value="false" />
<property name="preTestSQLString" value="SELECT 1 FROM TABLE1" />
<property name="user" value="*******" />
<property name="password" value="*******" />

FYI : I am using sqljdbc.jar extracted from sqljdbc_1.0.809.102_enu.exe that
is downloaded from microsoft site. This code is working absolutely fine with
Sql Server 2000.

I HOPE SOMEONE FROM MICROSOFT WILL HELP ME WITH THIS.

Thanks,
Kotha.
.



Relevant Pages

  • RE: [dbi] Re: MsSQL DBD::ODBC IsNull and undef
    ... I'd guess this is because the SQL Server ODBC driver is looking at your ... Martin J. Evans ... can you run your test script again but creating an OOB log file ...
    (perl.dbi.users)
  • Re: Padding using Type 4 Drivers
    ... |> value than what you have set in SQL Server 2000. ... |> settings that you require. ... |> Are you using the Microsoft JDBC driver or a third-party driver?. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: MsSQL DBD::ODBC IsNull and undef
    ... Martin J. Evans ... On 26-Jul-2005 Brian Becker wrote: ... > ensure you tell your driver the type of the column in bind_col. ... > I'd guess this is because the SQL Server ODBC driver is looking at your ...
    (perl.dbi.users)
  • Re: XA and 2000 backwards compatibility
    ... We haven't deployed the SQL2K XA driver either, so this should work for us. ... I am going through the documentation for the SQL Server driver. ... and enable XA transactions in MSDTC on the SQL Server ... Goto MSDTC tab on properties, click "Security Configuration" button, ...
    (microsoft.public.sqlserver.jdbcdriver)
  • RE: [dbi] Re: MsSQL DBD::ODBC IsNull and undef
    ... ensure you tell your driver the type of the column in bind_col. ... To: Brian Becker ... I'd guess this is because the SQL Server ODBC driver is looking at your ... Martin J. Evans ...
    (perl.dbi.users)