时间:2021-07-01 10:21:17 帮助过:2人阅读
Oracle
String driver = "oracle.jdbc.driver.OracleDriver"; // 驱动程序名 String dbname = "mydb"; String ip = "192.168.56.50"; String port = "1521"; String user = "root"; String password = "root"; String url = "jdbc:oracle:thin:@" + ip + ":" + port + ":" +dbname; //加载数据库驱动 Class.forName(driver); //连接数据库 Connection conn = DriverManager.getConnection(url, user, password);
JDBC 连接数据库
标签: