Oracle,SqlServer,MySql数据库链接语句和驱动类

1:oracle:

   driver = "oracle.jdbc.driver.OracleDriver";
   url = "jdbc:oracle:thin:@localhost:1521:" + dbname;

 

2:SqlServer:

 driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
   url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=" + dbname;

注意:sqlserver 2005 使用的是sqljdbc.jar

          sqlserver 2008 使用的是sqljdbc4.jar

3:MySql:

driver = "com.mysql.jdbc.Driver";
   url="jdbc:mysql://localhost:3306/" + dbname;

你可能感兴趣的:(Oracle,SqlServer,MySql数据库链接语句和驱动类)