JDBC連線各種資料庫的字串

2021-07-02 19:53:36 字數 768 閱讀 9705

oracle driverclass:oracle.jdbc.driver.oracledriver 

url:jdbc: oracle: thin: @127.0.0.1 : 1521 : orcl

資料庫的使用者名稱和密碼寫在connection connection = drivermanager.getconnection(url, "scott", "tiger");

方法裡面mysql driverclass:com.mysql.jdbc.driver url:jdbc: mysql: //localhost:3306/資料庫名稱

資料庫的使用者名稱和密碼寫在connection connection = drivermanager.getconnection(url, "資料庫的名稱", "密碼");

方法裡面sql server2005 driverclass:com.microsoft.sqlserver.jdbc.sqlserverdriver url:jdbc: sqlserver: //localhost:1433; databasename=資料庫名稱

資料庫的使用者名稱和密碼寫在connection connection = drivermanager.getconnection(url, "資料庫名稱", "密碼");方法裡面

public static void main(string args)

} catch(exception e) finally catch(exception e2)

}}

JDBC連線各種資料庫的連線字串

1 oracle8 8i 9i 資料庫 thin 模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 orcl orcl 為資料庫的 sid s...

JDBC連線各種資料庫

1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 orcl orcl為資料庫的sid strin...

JDBC連線各種資料庫

1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost 1521 orcl orcl為資料庫的sid strin...