各种数据库的JDBC驱动下载及连接字符串URL写法.pdf
《各种数据库的JDBC驱动下载及连接字符串URL写法.pdf》由会员分享,可在线阅读,更多相关《各种数据库的JDBC驱动下载及连接字符串URL写法.pdf(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、各种数据库的JDBC驱动下载及连接字符串URL 写法sun 官方网站上的JDBC 驱动列表:url=http:/ 据 库说明MySQL url=http:/ Shipped.But need to download the latest for MySQL 4.1 or higher.Oracle url=http:/ Server by jTDS url=http:/ Microsoft SQL Server(6.5,7,2000 and 2005)Postgres url=http:/jdbc.postgresql.org/download.htmlhttp:/jdbc.postgresq
2、l.org/download.html/url Included 7.3 JDBC 3 SAP DB url=http:/www.sapdb.org/sap_db_jdbc.htmhttp:/www.sapdb.org/sap_db_jdbc.htm/url Included.SyBase by jTDS url=http:/ Sybase(10,11,12)以下内容来自互联网1.MySQL(url=http:/http:/ ysql-connector-java-2.0.14-bin.jar;Class.forName(org.gjt.mm.mysql.Driver);cn=DriverMa
3、nager.getConnection(jdbc:mysql:/MyDbComputerNameOrIP:3306/myDatabaseName,sUsr,sPwd);2.PostgreSQL(url=http:/www.de.postgresql.orghttp:/www.de.postgresql.org/url)pgjdbc2.jar;Class.forName(org.postgresql.Driver);cn=DriverManager.getConnection(jdbc:postgresql:/MyDbComputerNameOrIP/myDatabaseName,sUsr,sP
4、wd);3.Oracle(url=http:/ SQLServer(url=http:/http:/ SQLServer(url=http:/http:/ rosoft.jdbc.sqlserver.SQLServerDriver);cn=DriverManager.getConnection(jdbc:microsoft:sqlserver:/MyDbComputerNameOrIP:1433;databaseName=master,sUsr,sPwd);7.ODBC Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);Connection cn=Driv
5、erManager.getConnection(jdbc:odbc:+sDsn,sUsr,sPwd);8.DB2 Class.forName(.DB2Driver);String url=jdbc:db2:/192.9.200.108:6789/SAMPLE cn=DriverManager.getConnection(url,sUsr,sPwd);9.access由于 access并不是作为一项服务运行,所以url 的方法对他不适用。access可以通过 odbc,也可以通过服务器映射路径的形式找到.mdb文件,参见url=http:/rmijdbc.objectweb.org/Access
6、/access.htmlhttp:/rmijdbc.objectweb.org/Access/access.html/urlJDBC API的使用方法(1)登记并加载JDBC 驱动程序;两种方法:文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档
7、编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2
8、W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q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9D9R3Z4 HB3D2
12、W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4Class.forName(String drivername);DriverManager.registerDriver(Driver driver)(2)建立与
13、 SQL 数据库的连接;DriverManager的 getConnection()方法:Connection getConnection(String url):url表示数据库地址字符串;Connection getConnection(String url,String user,String pwd)Connection getConnection(String url,Properties info)(3)传送一个SQL 查询;Connection的 createStatement()方法:Statement createStatement();Statement 可以执行SQL 语
14、句,得到SQL 查询结果。(4)获得结果集。Statement 的执行 SQL 语句方法:ResultSet executeQuery(String sql):执行 select语句int executeUpdate(String sql):执行更新语句,如insert,delete,update.(5)检索查询结果。ResultSet的方法:boolean next():没有行时返回false;String getString(String columnName):返回列名对应的值。posted on 2007-07-01 16:09 和田雨阅读(153)评论(1)编辑收藏引用所属分类:JD
15、BC 评论#re:各种数据库的JDBC驱动下载及连接字符串URL 写法2007-07-02 19:28 和田雨为了方便大家查找,整理内容如下:1.MySQL(url=http:/)mm.mysql-2.0.2-bin.jarhttp:/)mm.m ysql-2.0.2-bin.jar/url Class.forName(org.gjt.mm.mysql.Driver);cn=DriverManager.getConnection(jdbc:mysql:/MyDbComputerNameOrIP:3306/myDatabaseName,sUsr,sPwd);2.PostgreSQL(url=ht
16、tp:/www.de.postgresql.org)pgjdbc2.jarhttp:/www.de.postgresql.org)pgjdbc2.jar/url Class.forName(org.postgresql.Driver);cn=DriverManager.getConnection(jdbc:postgresql:/MyDbComputerNameOrIP/myDatabaseName,sUsr,sPwd);3.Oracle(url=http:/ HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9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 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码
23、:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4Class.forName(oracle.jdbc.driver.OracleDriver);cn=DriverManager.getConnection(jdbc:oracle:thin:MyDbComputerNameOrIP:1521:ORCL,sUsr,sPwd);4.Sybase(url=http:/)jconn2.jarhttp:/)jconn2.jar/url Class.forName(com.sybase.jdbc2.jdbc.SybDriver);cn=DriverManager.getConnecti
24、on(jdbc:sybase:Tds:MyDbComputerNameOrIP:2638,sUsr,sPwd);/(Default-Username/Password:dba/sql)5.Microsoft SQLServer(url=http:/http:/ SQLServer(url=http:/http:/ Class.forName(sun.jdbc.odbc.JdbcOdbcDriver);Connection cn=DriverManager.getConnection(jdbc:odbc:+sDsn,sUsr,sPwd);8.DB2(新添加)Class.forName(.DB2D
25、river);String url=jdbc:db2:/192.9.200.108:6789/SAMPLE cn=DriverManager.getConnection(url,sUsr,sPwd);9.Microsoft SQL Server series(6.5,7.x and 2000)and Sybase 10 JDBC Name:jTDS URL:url=http:/ Download URL:url=http:/ HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2W1L5Q3 ZS5T6B1T7Q4文档编码:CL2Y9D9R3Z4 HB3D2
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 各种 数据库 JDBC 驱动 下载 连接 字符串 URL 写法
限制150内