File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Cannot create JDBC driver of class ..SQLServerDriver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Cannot create JDBC driver of class ..SQLServerDriver" Watch "Cannot create JDBC driver of class ..SQLServerDriver" New topic
Author

Cannot create JDBC driver of class ..SQLServerDriver

Nirav San
Greenhorn

Joined: Mar 25, 2008
Posts: 4
Hello experts,

I am using IBM rational eclipse, sql2005 and websphere 6.0 using dsn.
i have configured websphere for accessing sql2005 and the problem starts now, I configured jdbc_registry.properties file as follow..



when I start my workspace it gives me following exception


Cannot create JDBC driver of class 'com.microsoft.jdbc.sqlserver.SQLServerDriver' for connect URL 'jdbc: sqlserver://dbserver:1433;DatabaseName=ons5dev_2005;user=abc;password=12345'
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:261)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at com.onproject.security.registry.JdbcRegistry.getConnection(JdbcRegistry.java:188)
at com.onproject.security.registry.JdbcRegistry.checkPassword(JdbcRegistry.java:225)
at com.ibm.ws.security.registry.UserRegistryImpl.checkPassword(UserRegistryImpl.java:296)
at com.ibm.ws.security.server.lm.swamLoginModule.login(swamLoginModule.java:429)
at com.ibm.ws.security.common.auth.module.proxy.WSLoginModuleProxy.login(WSLoginModuleProxy.java:122)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke......


I have sqljdbc2005.jar in my .classpath file as seen in eclipse for my project. i think this issue is related to classpath but dont know how to fix it. your word of advice would be a great help to me.

I have tested driver using a jdbc demo application and found it working.
[ March 26, 2008: Message edited by: Nirav San ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"ns ns",
Please check your private messages regarding an important administrative matter.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bindesh Nair
Greenhorn

Joined: Oct 09, 2007
Posts: 12
Looks like you don't have the driver in your build classpath. Can you check ?
Ajith Prasad
Ranch Hand

Joined: Aug 22, 2006
Posts: 66
ya, no driver in your classpath or it not loaded properly
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Welcome to Javaranch.

java.sql.SQLException: No suitable driver


just make it zoom for you.

I have tested driver using a jdbc demo application and found it working.


have you tested with SQL 2005?

for more info about the sql 2005 drivers visit General Jdbc Questions


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Nirav San
Greenhorn

Joined: Mar 25, 2008
Posts: 4
The driver is there in my classpath. file as can be seen from my eclipse IDE.

yes, I have tested driver for sql2005.

thanks
Bindesh Nair
Greenhorn

Joined: Oct 09, 2007
Posts: 12
Never worked in websphere, but my gut feeling is that we need to drop the driver in J2EE environment too e.g. in apache tomcat i would have dropped it in the lib folder for Tomcat to check if it works.
 
GeeCON Prague 2014
 
subject: Cannot create JDBC driver of class ..SQLServerDriver