Jarrod Hermer on Fri, 21 Feb 2003 10:29:33 +0200 (SAST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Linux dev] Re: Java NullPointerException


Title: RE: [Linux dev] Java NullPointerException

Thanks Danie! It seems like that was the problem, somehow I must have forgoten about that particular configuration requirment J

-----Original Message-----
From: Viljoen, Danie [mailto:danie.viljoen@xxxxxxxxxxx]
Sent: Friday, February 21, 2003 8:18 AM
To: jarrod@xxxxxxxxxx
Subject: RE: [Linux dev] Java NullPointerException

 

Is your JDBC driver in the classpath in the production machine.

Send the stacktrace - it will give me a better idea of where your problem is?

Danie

-----Original Message-----
From: Jarrod Hermer [mailto:jarrod@xxxxxxxxxx]
Sent: 20 February 2003 04:05
To: dev@xxxxxxxxxxxx
Subject: [Linux dev] Java NullPointerException

 

Hi all,

I have a strange bug which I can't seem to pin down. Using Java 1.4.1 I
have a simple app that polls a MS SQL server for data using a stored
procedure here is my code:

------------------------------------------------------------------------
----

ResultSet rs = null;

try
{
        CallableStatement cs = conn.prepareCall("{call
GetUserByName(?)}");
        cs.setString(1, name);
        rs = cs.executeQuery();
}
catch(SQLException ex)
{
        System.out.println("ERROR getting user");
        System.out.println(ex.getMessage());
}

while(rs.next())
{
        // Do Stuff
}
rs.close();

------------------------------------------------------------------------
----

On my development machine it functions without any problems. However on
my production machine which I am convinced is identical the program
crashes with a Java.NullPointerException error.

Any ideas?

Regards,
Jarrod