Java連線資料庫

2021-03-31 18:51:18 字數 1171 閱讀 9476

1、oracle8/8i/9i資料庫(用thin模式)

class.forname("oracle.jdbc.driver.oracledriver").newinstance(); 

string url="jdbc:oracle:thin:@localhost:1521:orcl";

2、sql server7.0/2000資料庫

class.forname("***.microsoft.jdbc.sqlserver.sqlserverdriver").newinstance();

string url="jdbc:microsoft:sqlserver://localhost:1433;databasename=pubs";

3、db2資料庫

4、informix資料庫

class.forname("***.informix.jdbc.ifxdriver").newinstance();

string url = "jdbc:informix-sqli://123.45.67.89:1533/testdb:informixserver=myserver;

5、sybase資料庫

class.forname("***.sybase.jdbc.sybdriver").newinstance();

string url =" jdbc:sybase:tds:localhost:5007/tsdata";

6、mysql資料庫

class.forname(".gjt.mm.mysql.driver").newinstance();

string url = "jdbc:mysql://localhost/softforumuser=soft&password=soft1234&useunicode=true&characterencoding=8859_1"

7、postgresql資料庫

class.forname(".postgresql.driver").newinstance();

string url ="jdbc:postgresql://localhost/soft"

JAVA連線資料庫語句

class.forname 驅動字串 connection connection drivermanager.getconnection 連線字串 sql 2000 1 通用的jdbc odbc橋連線 驅動字串sun.jdbc.odbc.jdbcodbcdriver 連線字串jdbc odbc 資料...

Java連線資料庫例項

此文中的 主要列出連線資料庫的關鍵 其他訪問資料庫 省略 1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin localhost...

java遠端連線資料庫

我在eclipse執行報的錯,沒報錯就不管了。null,message from server host 202.197.100.120 is not allowed toconnect to this mysql server 在伺服器 一 開啟 mysql 控制檯,輸入 二 輸入 如果報錯 my...

Java連線資料庫方式大全

mysql string driver com.mysql.jdbc.driver 驅動程式 string url jdbc mysql localhost 3306 db name 連線的url,db name為資料庫名 string username username 使用者名稱 string ...

java 連線資料庫錯誤總結

昨天第一天接到任務,把資料庫中name相同的行,將第一條中列不為空的內容複製到第二條為空的對應位置。public static void main string args rs.close statement.close for int j 0 j id.size j for int i 0 i i...