标签:
引自博文:http://blog.csdn.net/vebasan/article/details/5057653
一、MySQL:
driverClass:com.mysql.jdbc.Driver
org.gjt.mm.mysql.Driver
jdbcUrl:jdbc:mysql://192.168.0.1:3306/yourDBName
硬编码(不建议):
Class.forName("com.mysql.jdbc.Driver", true, Thread.currentThread().getContextClassLoader());
conn=DriverManager.getConnection("jdbc:mysql://192.168.0.1:3306/yourDBName?user=userName&password=123&useUnicode=true&characterEncoding=gb2312");
二、Oracle:
(thin模式)
driverClass:oracle.jdbc.driver.OracleDriver
jdbcUrl:jdbc:oracle:thin:@192.168.0.1:1521:yourDBName
三、SQL Server:
driverClass:com.microsoft.sqlserver.jdbc.SQLServerDriver(2005版本及以后)
com.microsoft.jdbc.sqlserver.SQLServerDriver(2000版本)
jdbcUrl:jdbc:sqlserver://192.168.0.1:1433;databasename=yourDBName
四、Sybase:
driverClass:com.sybase.jdbc3.jdbc.SybDriver
com.sysbase.jdbc.SybDriver
jdbcUrl:jdbc:sybase:Tds:127.0.0.1:5007/myDB
五、DB2:
1、db2java.zip
driverClass:COM.ibm.db2.jdbc.net.DB2Driver
jdbcUrl:jdbc:db2://127.0.0.1:5000/DBNAME
标签:
原文地址:http://www.cnblogs.com/2027437606qq/p/5034549.html