Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / May 2008

Tip: Looking for answers? Try searching our database.

java connect to MSSQL2k

Thread view: 
a - 05 May 2008 09:49 GMT
Hi.

I am not able to load the driver for MSSQL2000 server, even I have put all 3
jar files, mssqlserver.jar, msutil.jar, msbase.jar in lib folder and have
tried to restart the tomcat.
I got ClassNotFoundException. How should I set the Class.forName?
My code,

public DBConnect(String host, String dbname, String username, String
password)
{
 //Load Drv
 try
 {
  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
 } catch(ClassNotFoundException cnfe) {
  System.err.println(cnfe);
 }
 //Define the connection
 msSqlURL = "jdbc:odbc:" + dbname;
}
Arne Vajhøj - 05 May 2008 13:10 GMT
> I am not able to load the driver for MSSQL2000 server, even I have put all 3
> jar files, mssqlserver.jar, msutil.jar, msbase.jar in lib folder and have
[quoted text clipped - 9 lines]
>   {
>    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

Try:

com.microsoft.jdbc.sqlserver.SQLServerDriver

for 2000 (the one you use are for 2005).

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.