Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > java connect to...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3739 of 3747
Post > Topic >>

java connect to MSSQL2k

by "a" <a@[EMAIL PROTECTED] > May 5, 2008 at 08:49 AM

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;
 }




 2 Posts in Topic:
java connect to MSSQL2k
"a" <a@[EMAI  2008-05-05 08:49:18 
Re: java connect to MSSQL2k
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-05 08:10:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 23:57:33 CDT 2008.