1. mysql(
"org.gjt.mm.mysql.driver
");
=drivermanager.getconnection(
"jdbc:mysql://mydbcomputernameorip:3306/mydatabasename
", susr, spwd );
2. postgresql(
"org.postgresql.driver
");
=drivermanager.getconnection(
"jdbc:postgresql://mydbcomputernameorip/mydatabasename
", susr, spwd );
3. oracle(
"oracle.jdbc.driver.oracledriver
");
=drivermanager.getconnection(
"jdbc:oracle:thin:@mydbcomputernameorip:1521:orcl
", susr, spwd );
4. sybase(
"com.sybase.jdbc2.jdbc.sybdriver
");
=drivermanager.getconnection(
"jdbc:sybase:tds:mydbcomputernameorip:2638
", susr, spwd );
//(default-username/password: "dba"/"sql")
5. microsoft sqlserver(
"net.sourceforge.jtds.jdbc.driver
");
=drivermanager.getconnection(
"jdbc:jtds:sqlserver://mydbcomputernameorip:1433/master
", susr, spwd );
6. microsoft sqlserver(
"com.microsoft.jdbc.sqlserver.sqlserverdriver
");
=drivermanager.getconnection(
"jdbc:microsoft:sqlserver://mydbcomputernameorip:1433;databasename=master
", susr, spwd );
7.jdbc-odbc(非資料來源方式)
newsun.jdbc.odbc.jdbcodbcdriver();
connection conn
=drivermanager.getconnection(
"jdbc:odbc:driver=;server=.;database=pubs;user=sa;pwd=");
8. odbc (普通資料來源方式)
"sun.jdbc.odbc.jdbcodbcdriver
");
connection cn
=drivermanager.getconnection(
"jdbc:odbc:"+
sdsn, susr, spwd );
9.db2
class.forname(
"com.ibm.db2.jdbc.net.db2driver
");
string url="
jdbc:db2:
"=drivermanager.getconnection( url, susr, spwd );
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 鏈結sqlserver2000 驅動類com.microsoft.jdbc.sqlserver.sqlserverdriver 連線字串 jdbc microsoft sqlserver host 1433 databasename pubs 注 host為主機位址,1433是資料庫主機的預設埠...
jdbc連線資料庫大全
鏈結 sql資料庫 class.forname com.microsoft.jdbc.sqlserver.sqlserverdriver string url jdbc microsoft sqlserver 192.168.100.9 1433 databasename asset string ...