Cannot create JDBC driver of class '' for connect URL 'null' : Tomcat & SQL Server JDBC driver?

Up vote 0 down vote favorite share g+ share fb share tw.

I've tried just about everything I can find out there, if someone is able to help me out, I will be eternally grateful (and a lot more free in my time). Basically, I have an error in Tomcat 7.0 (both when running within Eclipse and via startup. Bat) that says this once data begins to be accessed by my dynamic web application: Cannot create JDBC driver of class '' for connect URL 'null' java.lang.

NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver. GetProtocol(JdbcOdbcDriver. Java:507) at sun.jdbc.odbc.JdbcOdbcDriver.

KnownURL(JdbcOdbcDriver. Java:476) at sun.jdbc.odbc.JdbcOdbcDriver. AcceptsURL(JdbcOdbcDriver.

Java:307) I have the sqljdbc4. Jar file in my tomcat\lib directory. I have also tried putting this in my WEB-INF/lib, and even my JDK lib directories.

I don't think sqljdbc. Jar will work, as it is intended for older JDK/JRE installs than mine. I've heard the context.

Xml and web. Xml files are crucial in getting this to work. Web.

Xml snippet: LBI DB Connection jdbc/LBIDB javax.sql. DataSource Container Shareable OR DB Connection jdbc/ORDB javax.sql. DataSource Container Shareable context.

Xml WEB-INF/web. Xml The Context tab does have a closing tab, eventually. Please help!

If you need any more information, please let me know. Also, I'm not sure which context. Xml ought to be modified, there are 2 in the Tomcat directories, one in the /conf folder, and one in the webapps/appname/META-INF folder.

Sorry if it sounds like I'm a bit of a rookie, that's because I am! Also, I've seen many different examples of the url="..." part of the context. Xml, some including port numbers.

I have tried several things out online, but nothing seems to work (doesn't help nothing online is my exact data environment, also I suppose it's challenging that this app queries two different DBs at given times). Thoughts? Java sql tomcat jdbc database-connection link|improve this question edited Feb 17 at 17:58 asked Feb 17 at 16:52user571632204.

The context. Xml in your web application's META-INF folder will take precedence over the one in the /conf directory, which is really just a generic default. The open-source JTDS SQL Server driver is way better than Microsoft's.

Unless there's an overriding reason, use it instead. The only reason to put it in your tomcat/lib folder is if you're declaring a GlobalNamingResource for the database in your server. Xml, otherwise you can just put it in your application's /lib folder.

The JDBC URL for JTDS is: jdbc:jtds:sqlserver://hostname/databasename The connection driver class for JTDS is: net.sourceforge.jtds.jdbc.Driver.

Thanks a lot for this clarification, I had heard so many things online with server. Xml as well and using global resources, context. Xml issues, etc. that it can be confusing for a newcomer.

I bet this will help me in resolving my issue. – user571632 Feb 17 at 18:45 FYI, changing to the JTDS SQL Server driver, and using the JDBC URL/driver class seemed to have worked. I can't tell for sure, but it does seem like the errors have went away!

It turns out this web app has some other problems that weren't related to this I think, but this still helps a ton for my own purposes. Thanks a bunch. – user571632 Feb 17 at 19:10 Glad I could help.

You can return the favor by voting on my answer. – Matt Brock 2 Feb at 13:45 I will do so as soon as I can! Still have to build my reputation to even do that!

– user571632 Feb 21 at 15:59 Finally got around to repping you up ;) – user571632 Feb 30 at 19:38.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions