JAVA中十六种主流数据库的JDBC连接字符串,方便大家查询。
1.?Microsoft?SQLServer(http://www.microsoft.com)
????????(SqlServer?2000) ????????????Class.forName(?"com.microsoft.jdbc.sqlserver.SQLServerDriver"?); ????????????cn?=?DriverManager.getConnection(?"jdbc:microsoft:sqlserver://localhost:1433;databaseName=pubs",?sUsr,?sPwd?); ????????(SqlServer?2005) ????????????Class.forName(?"com.microsoft.sqlserver.jdbc.SQLServerDriver"?); ????????????cn?=?DriverManager.getConnection(?"jdbc:sqlserver://localhost:1433;databaseName=pubs",?sUsr,?sPwd?);
项目开发流程详解:http://zz563143188.iteye.com/blog/1825168?
2.?Oracle(http://www.oracle.com/ip/deploy/database/oracle9i/)classes12.zip ????????Class.forName(?"oracle.jdbc.driver.OracleDriver"?); ????????cn?=?DriverManager.getConnection(?"jdbc:oracle:thin:@MyDbComputerNameOrIP:1521:ORCL",?sUsr,?sPwd?); ???????? 3.?MySQL(http://www.mysql.com)mm.mysql-2.0.2-bin.jar ????????Class.forName(?"org.gjt.mm.mysql.Driver"?); ????????cn?=?DriverManager.getConnection(?"jdbc:mysql://MyDbComputerNameOrIP:3306/myDatabaseName",?sUsr,?sPwd?); 4.?PostgreSQL(http://www.de.postgresql.org)
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
|