Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JDBC & SQLServer

 
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
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • 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
 
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.
 
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
Scala Postgres Database Linux
  • 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.
 
please buy this thing and then I get a fat cut of the action:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic