|
Home > Archive > SQL Server JDBC > September 2005 > NPE in driver
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Jörg von Frantzius 2005-09-15, 3:23 am |
| Hi,
I'm seeing the following problem:
java.lang. NullPointerException
at com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter. initializeUserParam(
Unknown Source)
at
com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt. addUserParametersToR
PC(Unknown
Source)
at com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement. commonExecute(Unknow
n Source)
at com.microsoft.jdbc.base.BaseStatement. executeUpdateInterna
l(Unknown Source)
at com.microsoft.jdbc.base. BasePreparedStatemen
t. executeUpdate(Unknow
n Source)
Do other people agree that this must entirely be a problem of the JDBC-driver?
Regards,
Jörg
| |
| Robert Klemme 2005-09-15, 7:23 am |
| Jörg von Frantzius wrote:
> Hi,
>
> I'm seeing the following problem:
>
> java.lang. NullPointerException
> at
>
com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter. initializeUserParam(
Unkno
wn
> Source) at
>
com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt. addUserParametersToR
PC
(Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt.execute(Unknown
> Source)
> at com.microsoft.jdbc.base.BaseStatement. commonExecute(Unknow
n Source)
> at
> com.microsoft.jdbc.base.BaseStatement. executeUpdateInterna
l(Unknown
> Source)
> at
> com.microsoft.jdbc.base. BasePreparedStatemen
t. executeUpdate(Unknow
n
> Source)
>
> Do other people agree that this must entirely be a problem of the
> JDBC-driver?
I would not agree without seeing your and the driver's source code. It
could well be that you provide a null parameter which then triggers the
NPE.
Kind regards
robert
| |
| Joe Weinstein 2005-09-15, 1:23 pm |
|
Jörg von Frantzius wrote:
> Hi,
>
> I'm seeing the following problem:
>
> java.lang. NullPointerException
> at
> com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter. initializeUserParam(
Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt. addUserParametersToR
PC(Unknown
> Source)
> at
> com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt.execute(Unknown Source)
> at com.microsoft.jdbc.base.BaseStatement. commonExecute(Unknow
n Source)
> at
> com.microsoft.jdbc.base.BaseStatement. executeUpdateInterna
l(Unknown Source)
> at
> com.microsoft.jdbc.base. BasePreparedStatemen
t. executeUpdate(Unknow
n Source)
>
> Do other people agree that this must entirely be a problem of the
> JDBC-driver?
>
> Regards,
> Jörg
Yes. Even if your code is incorrect, there is very little excuse for a
driver throwing an NPE. If we can see your code, it will clear things
up. However, if the JDBC code is particularly bad, such as allowing
multiple threads to operate on a given Statement, then it is often
too costly and slow to protect a driver from that level of insult without
hurting it's performance under normal circumstances...
Joe
| |
| Jörg von Frantzius 2005-09-29, 11:23 am |
| Robert Klemme schrieb:
> Jörg von Frantzius wrote:
>
>
> com.microsoft.jdbc.sqlserver.tds.TDSRPCParameter. initializeUserParam(
Unkno
> wn
>
>
> com.microsoft.jdbc.sqlserver. SQLServerImplStateme
nt. addUserParametersToR
PC
> (Unknown
>
>
>
> I would not agree without seeing your and the driver's source code. It
> could well be that you provide a null parameter which then triggers the
> NPE.
Hm. If by "parameter" you mean a parameter to the PreparedStatement, why shouldn't it
be null if e.g. I want to insert NULL values? The only problem then could be a NOT
NULL constraint, but that should really look different I guess ;)
Regards,
Jörg
| |
| Jörg von Frantzius 2005-09-29, 11:23 am |
| Jörg von Frantzius schrieb:
> Hm. If by "parameter" you mean a parameter to the PreparedStatement, why
> shouldn't it be null if e.g. I want to insert NULL values? The only
> problem then could be a NOT NULL constraint, but that should really look
> different I guess ;)
Maybe not for BLOB columns, at least that was the problem for someone else:
http://forums.versant.com/forums/ma...ead?thread=984#
>
> Regards,
> Jörg
|
|
|
|
|