Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MS JDBC driver

 
dodo dimitrius
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I'm running Win XP SP2 SQL Server 2000 SP3a on my machine.
I've installed MS SQL Server driver for JDBC from MS site and have created an evironment variable called:
CLASSPATH = c:\Program Files\Microsoft SQL Server 2000 Driver forJDBC\lib\msbase.jar;c:\Program Files\Microsoft SQL Server 2000 Driver forJDBC\lib\msutil.jar;c:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar

I used this code to connect to db:

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://BBCD.TEST.COM:1433;DatabaseName=testDB;User=testUser;Password=testuser");
.....

I'm getting error:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: com.microsoft.jdbc.sqlserver.SQLServerDriver
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
.....

I've tried to locate the problem, and even if I leave just first line:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
I'm getting the same error message.
The page cannot find the driver or something else???
Any idea?
Thanks,
d.
 
Dave Salter
Ranch Hand
Posts: 293
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you running your application. Is CLASSPATH in your class path?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"dodo dodo",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
dodo dimitrius
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Bear!
Hi Dave,
What do you think by "Is CLASSPATH in your class path?".
Regards,
d.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web applications do not use the system CLASSPATH, this allows them to run multiple applications in a single server. The short answer is: try getting the jars from the location in you classpath and placing them in the <context>/WEB-INF/lib directory. If the lib directory does not exist, just create it.
 
dodo dimitrius
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David,
It's working.
Regards,
d.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic