Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC & SQLServer

 
Curtis Nelson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm trying to connect to SQLServer, but I keep getting an exception on the following line:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

I've downloaded and installed the JDBC driver from Microsoft, and set my classpath accordingly. Is there something else I'm missing?

Thanks,

Curtis
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which exception? Out of memory?
 
Curtis Nelson
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting a ClassNotFoundException.

Thanks
 
Rick Portugal
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a classpath issue. Double-check that the JAR is part of the classpath.
 
Yu Tao
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Curtis Nelson:
Hi all,

I'm trying to connect to SQLServer, but I keep getting an exception on the following line:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");

I've downloaded and installed the JDBC driver from Microsoft, and set my classpath accordingly. Is there something else I'm missing?

Thanks,

Curtis



please download JDBC driver from Microsoft.
under copy you-support(JDBC)/lib have msbase.jar mssqlserver.jar msutil.jar
copy three jar in you jdk/jre/lib/ext
that OK
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are different MsSqlServer versions out, which need different jdbc-drivers.
For 7.0 you may use the OpenSource FreeTTS Driver i.e.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic