Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #61

java connect to MSSQL2k

From "a" <a@THRWHITE.remove-dii-this>
Subject java connect to MSSQL2k
Message-ID <iSzTj.116130$Cj7.107115@pd7urf2no> (permalink)
Newsgroups comp.lang.java.databases
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
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;
 }

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextNext in thread | Find similar


Thread

java connect to MSSQL2k "a" <a@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: java connect to MSSQL "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web