Home >Database >Mysql Tutorial >数据库链接

数据库链接

WBOY
WBOYOriginal
2016-06-07 15:47:451132browse

项目做的多了,连最基本的链接数据库的方式都忘记了。今天记录以便以后查看 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");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn