1、鏈結sqlserver2000
驅動類
com.microsoft.jdbc.sqlserver.sqlserverdriver
連線字串
jdbc:microsoft:sqlserver://localhost:1433;databasename=pubs
(pubs為資料庫名,localhost為主機位址,若資料庫在遠端則為ip位址)
2、鏈結mysql
驅動類
com.mysql.jdbc.driver
連線字串
jdbc:mysql://localhost:3306/pubs
(pubs為資料庫名,localhost為主機位址,若資料庫在遠端則為ip位址)
java中jdbc鏈結資料庫大全
經常因為鏈結字串記不住或者記錯的原因浪費時間,終於有時間把常用的總結出來,要用就簡單了1 鏈結sqlserver2000 2 鏈結mysql 3 jdbc odbc橋鏈結 4 鏈結oracle oracle.jdbc.driver.oracledriver jdbc oracle thin loca...
Jdbc 鏈結資料庫
try rs.close ps.close conn.close try catch exception e if rs null if ps null if conn null catch sqlexception e console cpbm 09110444 資源已經釋放!ps is not ...
JDBC鏈結資料庫
1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 orcl orcl為資料庫的sid strin...