SQL Server 2000 JDBC Drive Surface Installation and Test Description (ZZ)

xiaoxiao2021-03-05  26

First, download the JDBC driver of SQLServer2000.

http://www.microsoft.com/china/sql/downloads/2000/jdbc.asp

http://support.microsoft.com/default.aspx?scid=kb;zh-cn; 313100 There is this driver in Microsoft Site: Window operating system http://www.uncj.com/upload/files/ms_jdbc_setup . / m l l l p p 操作 操作 2 l l l l l l q 系统 系统 系统 系统 系统 系统 系统 系统 操作 系统 系统 系统 系统 系统 系统. 系统 系统/ 200/unix/en-us/msqlserver.tar 2, install the JDBC to execute the MS_JDBC_SETUP.EXE executable, everything just click Next, until the Finish button appears, complete the installation. Note: (1) MS_JDBC_SETUP default installation path is: C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC (2) This version (Version 2.2.0022) This only supports Microsoft SQL Server 2000 Driver for JDBC (3) Installation Directory The three JAR files under lib / down are the JDBC driver core msbase.jar mssqlser.jar msutil.jar, add the three JAR files in the above (3) to the environment variable to ClassPath: D: / Webserver / lib / msbase.jar d: /webserver/lib/msqlser.jar D: /webserver/lib/msutil.jar Note: I recommend copying the above three files to the lib or class directory where your JVM is located. At this point, I copied it to the LIB under my JVM directory. Fourth, the test public class Test {public Test () {} public static void main (String args []) {try {Class.forName ( "com.microsoft.jdbc.sqlserver.SQLServerDriver"); Connection conn = DriverManager.getConnection ( "jdbc: microsoft: sqlserver: // localhost: 1433; User = sa; Password =; DatabaseName = maxwell"); Statement stmt = conn.createStatement (); String sql = "select * from employee"; ResultSet rs = stmt. ExecuteQuery (SQL); while (rs.next ()) {system.out.println ("Testname:" rs.getstring ("name"));}} rs.close (); stmt.close (); conn. CLOSE ();} catch (exception ex) {system.err.println (ex.getMessage ());}}} 5. Precautions 1.

转载请注明原文地址:https://www.9cbs.com/read-35133.html

New Post(0)