Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Kamron Abtahi
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic