各種資料庫的jdbc配置

2021-09-29 22:32:40 字數 980 閱讀 8472

以前mysql、mariadb進行jdbc操作的時候,驅動都是com.mysql.jdbc.driver,前一段時間,進行mariadb操作的時候突然不行了,現在對各個資料庫jdbc配置進行總結,以備不時之需。

//oracle配置

private static final string driver = "oracle.jdbc.driver.oracledriver";

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

private static final string user = "root";

private static final string password = "root";

//mariadb配置

private static string driver="org.mariadb.jdbc.driver";

private static string url="jdbc:mariadb://localhost:3306/test_partition";

private static final string user = "root";

private static final string password = "root";

//mysql配置

private static string driver="com.mysql.jdbc.driver";

private static string url="jdbc:mysql://localhost:18000/mycat_pc";

private static final string user = "root";

private static final string password = "root";

(未完待續)

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...

JDBC連線各種資料庫

下文中羅列了各種資料庫使用jdbc連線的方式,大家可以將其作為乙個手冊使用。1 oracle8 8i 9i資料庫 thin模式 class.forname oracle.jdbc.driver.oracledriver newinstance string url jdbc oracle thin ...