|
Home > Archive > SQL Server JDBC > December 2005 > Null pointer exception with Windows authentication
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]
| Author |
Null pointer exception with Windows authentication
|
|
|
| Using the new beta 2 JDBC driver I can connect successfully to SQL Server
2000 using Windows authentication. I can also execute a simple select
statement. However, when I attempt to execute a stored procedure, the
execUpdate statement gets a java.lang. NullPointerException
.
If I provide a user code and password and use SQL Server authentication to
connect, I can execute the stored procedure without any problem. I can also
execute the stored procedure successfully from a VB program that connects
through ADO using Windows authentication.
The code is listed below. I have verified that neither "con" nor "callStmt"
is null when executeUpdate is called. Is this a bug in the driver or am I
doing something wrong?
CallableStatement callStmt = con.prepareCall("{? = call
sw_GetInsert_User (?)}");
callStmt. registerOutParameter
(1,Types.INTEGER);
callStmt.setString(2, TrimString(pUserName
,
stwSchema.tUserName_size));
callStmt. setQueryTimeout(60);
callStmt.executeUpdate(); //This get the null pointer exception
pUserId[0] = callStmt.getInt(1);
callStmt.close();
Thanks in advance for any help.
| |
| Joe Weinstein 2005-12-01, 8:23 pm |
|
Sandy wrote:
> Using the new beta 2 JDBC driver I can connect successfully to SQL Server
> 2000 using Windows authentication. I can also execute a simple select
> statement. However, when I attempt to execute a stored procedure, the
> execUpdate statement gets a java.lang. NullPointerException
.
>
> If I provide a user code and password and use SQL Server authentication to
> connect, I can execute the stored procedure without any problem. I can also
> execute the stored procedure successfully from a VB program that connects
> through ADO using Windows authentication.
>
> The code is listed below. I have verified that neither "con" nor "callStmt"
> is null when executeUpdate is called. Is this a bug in the driver or am I
> doing something wrong?
>
> CallableStatement callStmt = con.prepareCall("{? = call
> sw_GetInsert_User (?)}");
> callStmt. registerOutParameter
(1,Types.INTEGER);
> callStmt.setString(2, TrimString(pUserName
,
> stwSchema.tUserName_size));
> callStmt. setQueryTimeout(60);
>
> callStmt.executeUpdate(); //This get the null pointer exception
> pUserId[0] = callStmt.getInt(1);
> callStmt.close();
>
> Thanks in advance for any help.
Show the full stacktrace of the nullpointer exception.
Joe Weinstein at BEA
>
| |
|
| The stack trace is listed below:
java.lang. NullPointerException
at
com.microsoft.sqlserver.jdbc.IOBuffer. setStringControlChar
acters(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.IOBuffer. bufferAppendRPCStrin
gUnicode(Unknown
Source)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement. sendParamsByRPC(Unkn
own
Source)
at
com.microsoft.sqlserver.jdbc. SQLServerCallableSta
tement. executeUpdate(Unknow
n
Source)
at SysWarehouse.modDatabase. StoreUser(modDatabas
e.java:579)
at SysWarehouse.modDatabase. getStaticIds(modData
base.java:277)
at SysWarehouse.modDatabase. ConnectDatabase(modD
atabase.java:237)
at SysWarehouse.IConnectDB. DBConnection(IConnec
tDB.java:65)
at PerfMonLoader.clsPMLoader. connectSTW(clsPMLoad
er.java:94)
at gui.Layout1.startAction(Layout1.java:1307)
at gui.Layout1$1.construct(Layout1.java:890)
at gui.SwingWorker$2.run(SwingWorker.java:167)
at java.lang.Thread.run(Unknown Source)
-Sandy
"Joe Weinstein" <joeNOSPAM@bea.com> wrote in message
news:O9RLPGs9FHA.740@TK2MSFTNGP11.phx.gbl...
>
>
> Sandy wrote:
>
>
> Show the full stacktrace of the nullpointer exception.
> Joe Weinstein at BEA
>
| |
| Joe Weinstein 2005-12-02, 3:23 am |
|
Sandy wrote:
> The stack trace is listed below:
>
> java.lang. NullPointerException
> at
> com.microsoft.sqlserver.jdbc.IOBuffer. setStringControlChar
acters(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.IOBuffer. bufferAppendRPCStrin
gUnicode(Unknown
> Source)
> at
> com.microsoft.sqlserver.jdbc.SQLServerStatement. sendParamsByRPC(Unkn
own
> Source)
> at
> com.microsoft.sqlserver.jdbc. SQLServerCallableSta
tement. executeUpdate(Unknow
n
> Source)
Ok. It's definitely a driver bug, so I hope this email is
enough to get them on it. I think it will. It looks like
DComms. getDatabaseCollation
() can return null so
IOBuffer. setStringControlChar
acters() might need
to check for that before calling .writeCollation().
Either that or IOBuffer.dbComm itself is null. (for MS).
Joe Weinstein at BEA Systems
> at SysWarehouse.modDatabase. StoreUser(modDatabas
e.java:579)
> at SysWarehouse.modDatabase. getStaticIds(modData
base.java:277)
> at SysWarehouse.modDatabase. ConnectDatabase(modD
atabase.java:237)
> at SysWarehouse.IConnectDB. DBConnection(IConnec
tDB.java:65)
> at PerfMonLoader.clsPMLoader. connectSTW(clsPMLoad
er.java:94)
> at gui.Layout1.startAction(Layout1.java:1307)
> at gui.Layout1$1.construct(Layout1.java:890)
> at gui.SwingWorker$2.run(SwingWorker.java:167)
> at java.lang.Thread.run(Unknown Source)
>
> -Sandy
>
> "Joe Weinstein" <joeNOSPAM@bea.com> wrote in message
> news:O9RLPGs9FHA.740@TK2MSFTNGP11.phx.gbl...
>
>
>
| |
|
| I found a similar problem reported in the MSDN Product Feedback Center
with the following response:
Resolved as By Design by Microsoft on 2005-10-28 at 15:08:14
Unfortunately integrated authentication will not be fully supported until
the next release of the JDBC driver, in the first half of 2006. If you
have
further questions feel free to contact me directly at
shelbyg@microsoft.com.
-Sandy
| |
| Angel Saenz-Badillos[MS] 2005-12-07, 3:23 am |
| Sandy,
You are unfortunatelly correct, we will not be shipping integrated
authentication support on the v1.0 release of the driver. It is our top
feature for v1.1 which will ship "within a reasonable window" of Sql Server
2005 service pack 1.
--
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"Sandy" <Sandy.Hickoff@unisys.com> wrote in message
news:dn283o$q29$1@si
05.rsvl.unisys.com...
>I found a similar problem reported in the MSDN Product Feedback Center
> with the following response:
>
> Resolved as By Design by Microsoft on 2005-10-28 at 15:08:14
>
> Unfortunately integrated authentication will not be fully supported until
> the next release of the JDBC driver, in the first half of 2006. If you
> have
> further questions feel free to contact me directly at
> shelbyg@microsoft.com.
>
> -Sandy
>
|
|
|
|
|