- 1、本文档共7页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
jdbc 访问各种数据库 url 语法(总结篇)(JDBC access various database URL syntax (summary))
jdbc 访问各种数据库 url 语法(总结篇)(JDBC access various database URL syntax (summary))
When we write JAVA programs, access databases, or configure connection pools, we often use JDBC to access the databases URL syntax, and summarize some of the commonly used drivers and syntax as follows:
(note that the corresponding drivers are matched, and different drivers require different URL syntax)
A. Firebird
Url=jdbc:firebirdsql:[HOST_NAME]/[PORT:][FULL_PATH_TO_DATABASE_FILE]
Driver=org.firebirdsql.jdbc.FBDriver
B. Informix
Url=jdbc:informix-sqli:[HOST_NAME]: [PORT]/[DATABASE_NAME]
Driver=com.informix.jdbc.IfxDriver
C. Interbase
Url=jdbc:interbase:[HOST_NAME]/[PORT:][FULL_PATH_TO_DATABASE_FILE]
Driver=interbase.interclient.Driver
D. Microsoft SQL Server
Url=jdbc:microsoft:sqlserver://[Server Name]: [PORT]
Driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
E. MySQL
Url=jdbc:mysql://[HOST]: [PORT]/[database_name]
Driver=com.mysql.jdbc.Driver
F. Oracle
Url=jdbc:oracle:thin:@[SERVER_NAME]: [PORT]: [DBNAME]
Driver=oracle.jdbc.driver.OracleDriver
G. PostgreSQL
Url=jdbc:postgresql://[SERVER_NAME]/[DATABASE_NAME]
Driver=org.postgresql.Driver
H. SAP DB
Url=jdbc:sapdb://[SERVER_NAME]/[DATABASE_NAME]
Driver=com.sap.dbtech.jdbc.DriverSapDB
I. Sybase
Url=jdbc:sybase:Tds:[SERVER_NAME]: [PORT]/[DATABASE_NAME]
Driver=com.sybase.jdbc2.jdbc.SybDriver
J. JDBC-ODBC Bridge
Url=jdbc:odbc:ODBC_DATASOURCE
Driver=sun.jdbc.odbc.JdbcOdbcDriver
K. DB2
Url=jdbc:db2://[SERVER_NAME]: [PORT]/[DATABASE_NAME]
Driver=COM.ibm.db2.jdbc.app.DB2Driver
==============================================================
The main code in this article lists the key code to connect to the database, and other access to database code omitted
1, Oracle8/8i/9i database (thin mode)
Class.forName (oracle.jdbc.driver.OracleDriver).NewInstance ();
String url= jdbc:oracle:thin:@localhost:1521:orcl;
//orcl is the SID of the database
String user= test;
String password= test;
Connection, conn=, DriverManager.getConnection (URL, user, password)
您可能关注的文档
- joo1(joo1).doc
- java面试纠错题目大全(Java interview error correction topics).doc
- jorinde and joringel(jorinde和joringel).doc
- js document对象(i document对象).doc
- java面象对象编程(Java object like programming).doc
- jsp input限制输入(JSP input restrict input).doc
- js语句及语法(JS statements and syntax).doc
- juniper基本配置入门(Introduction to basic configuration of juniper).doc
- js语法(JS syntax).doc
- jtgkuy(jtgkuy).doc
文档评论(0)