Friday, April 20, 2012

JDBC to SQL Server connection

I'm trying to connect to a SQLServer DB using JDBC. I'm using jre 1.6 and I've added the 'sqljdbc/jar' to my class path on my OS. I've also added that jar far to my build path. When my code hits this line
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
it explodes. I can navigate to the class in the package explorer, I can also type out the namespace and eclipse intellisense picks it up as well, yet when it loads I get
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver.
I'm using Eclipse Indigo Release 2 w/ Spring STS plugin, can any one tell me whats going on? btw: I can connect to my db using the DB using DB Explorer in Eclipse.





No comments:

Post a Comment