Forums Register Login

java.lang.NullPointerException thrown for com.microsoft.sqlserver.jdbc.SQLServerDriver connection

+Pie Number of slices to send: Send
Hello Everyone,

I am having an issue with trying to connect to the SQL database i have been using for an application. When testing my application within my Eclipse IDE, i have no problems accessing SQL. I am able to use the Class.forname(com.microsoft.sqlserver.jdbc.SQLServerDriver) with no incident. Once i export the application as a .war and drop it into my webapps folder of apache tomcat 6.0 i run into issues. It will throw that NullPointerException on my rs.next() since rs is null because the connection was never made. My research for the last day or two has pointed to a missing .jar file in the common library folder. I have the sqljdbc.jar in that lib and within the WEB-INF/lib folder. I have numerous combinations of each and can not get it to work in my deployment outside of eclipse. Any ideas? Thank you in advance for the help.

P.S.

I read adding it to the classpath may fix it. I thought putting it into the lib folder would do this automatically, but i still try to append the com.microsoft.sqlserver.jdbc onto the bootstrap.jar that is being using when its started up. This also did not work.
+Pie Number of slices to send: Send
Hi,

can you post the full info on this exception? You problably have more details than just ""java.lang.NullPointerException".
Maybe there is something else wrong, and the error details might help us.


I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2695 times.
Similar Threads
JDBC Driver for Sql Server Class not found Exception
Configuring SQL Server 2008 to JBOSS
Not able to connect to MS SQL 2005 Evaluation version
JSP JSTL No Suitable driver found for a Glassfish v3 Connection Pool using SQL Server 2005 Eclipse H
Can't connect to SQL server 2005
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:13:58.