Home  >  Article  >  Database  >  数据库-----常用数据库连接方法

数据库-----常用数据库连接方法

WBOY
WBOYOriginal
2016-06-07 16:11:061052browse

Oracle Driver oracle.jdbc.driver.OracleDriver URL jdbc:oracle:thin:@loaclhost:1521:orcl // orcl为数据库的SID MySQL Driver com.mysql.jdbc.Driver URL jdbc:mysql://localhost:3306/db_name // db_name为数据库名 Microsoft SQL Server 2.0驱动(3个ja

Oracle

Driver oracle.jdbc.driver.OracleDriver

URL jdbc:oracle:thin:@loaclhost:1521:orcl // orcl为数据库的SID

MySQL

Driver com.mysql.jdbc.Driver

URL jdbc:mysql://localhost:3306/db_name // db_name为数据库名

Microsoft SQL Server 2.0驱动(3个jar的那个);还可使用jTDS连接SQLServer数据库

Driver com.microsoft.jdbc.sqlserver.SQLServerDriver

URL jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name // db_name为数据库名

Microsoft SQL Server 3.0驱动(1个jar的那个)

Driver com.microsoft.sqlserver.jdbc.SQLServerDriver";

URL jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name // db_name为数据库名

Sysbase

Driver com.sybase.jdbc.SybDriver

URL jdbc:Sysbase://localhost:5007/db_name // db_name为数据可名

PostgreSQL

Driver org.postgresql.Driver";

URL jdbc:postgresql://localhost/db_name // db_name为数据可名

DB2

Driver com.ibm.db2.jdbc.app.DB2.Driver // 连接具有DB2客户端的Provider实例

//Driver com.ibm.db2.jdbc.net.DB2.Driver // 连接不具有DB2客户端的Provider实例

URL jdbc:db2://localhost:5000/db_name // db_name为数据库名

Informix

Driver com.informix.jdbc.IfxDriver

URL jdbc:Informix-sqli://localhost:1533/db_name:INFORMIXSER=myserver //db_name为数据可名

JDBC-ODBC

Driver sun.jdbc.odbc.JdbcOdbcDriver

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