标签:
MySQL数据库:
Driver="path/to/jdbc-drivers/mysql-connector-java-5.1.35-bin.jar"
Class="com.mysql.jdbc.Driver"; //驱动程序
URL="jdbc:mysql://localhost:3306/db_name"; //连接的URL,db_name为数据库名
MySQL JDBC driver驱动:https://dev.mysql.com/downloads/connector/j/
SQL server数据库:
Driver="path/to/jdbc-drivers/sqljdbc4.jar"
Class="com.microsoft.jdbc.sqlserver.SQLServerDriver";
URL="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name"; //db_name为数据库名
Microsoft SQL Server 2.0驱动(3个jar):https://www.microsoft.com/en-us/download/confirmation.aspx?id=2505
Oracle数据库:
Driver="path/to/jdbc-drivers/ojdbc6-12.1.0.2.jar"
Class="oracle.jdbc.driver.OracleDriver";
URL="jdbc:oracle:thin:@loaclhost:1521:orcl"; //orcl为数据库的SID
DB2数据库:
//连接具有DB2客户端的Provider实例
Driver="path/to/jdbc-drivers/jt400.jar"
Class="com.ibm.db2.jdbc.app.DB2.Driver";
URL="jdbc:db2://localhost:5000/db_name"; //db_name为数据可名
PostgreSQL数据库:
Driver="path/to/jdbc-drivers/postgresql-9.4.1201.jdbc4.jar"
Class="org.postgresql.Driver"; //连接数据库的方法
URL="jdbc:postgresql://localhost/db_name"; //db_name为数据可名
PostgreSQL JDBC driver驱动: https://jdbc.postgresql.org/download.html
标签:
原文地址:http://www.cnblogs.com/licongyu/p/5535833.html