Heim >Datenbank >MySQL-Tutorial >数据库链接
项目做的多了,连最基本的链接数据库的方式都忘记了。今天记录以便以后查看 oracle/mysql Class.forName(oracle.jdbc.driver.OracleDriver/com.mysql.jdbc.Driver); Connection connoracl = DriverManager.getConnection(jdbc:oracle:thin:@192.168.1.252:15
项目做的多了,连最基本的链接数据库的方式都忘记了。今天记录以便以后查看
oracle/mysql
Class.forName("oracle.jdbc.driver.OracleDriver"/com.mysql.jdbc.Driver);
Connection connoracl = DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.252:1521:orcl"/jdbc:mysql://192.168.1.252:3306/ecmsdb?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull, "username", "password");