• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

MS JDBC driver

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 293
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you running your application. Is CLASSPATH in your class path?
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry Bear!
Hi Dave,
What do you think by "Is CLASSPATH in your class path?".
Regards,
d.
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks David,
It's working.
Regards,
d.
 
Nothing up my sleeve ... and ... presto! A tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic