当前位置: 技术问答>java相关
给大家提个问题,jdbc和database的
来源: 互联网 发布时间:2015-03-20
本文导语: 给大家提个问题: 那位高手为大家做点贡献吧,新版主帮大家做点实事, 总结一下用java连接database问题,省的大家老问,也方便查询: 一、jdbc-odbc database: sqlserver7/sqlserver2000 oracle 8i mysql db2 具体怎样连接,请具体到语句...
给大家提个问题:
那位高手为大家做点贡献吧,新版主帮大家做点实事,
总结一下用java连接database问题,省的大家老问,也方便查询:
一、jdbc-odbc
database:
sqlserver7/sqlserver2000
oracle 8i
mysql
db2
具体怎样连接,请具体到语句怎样写,如
sun.jdbc.odbc.JdbcOdbcDriver
jdbc:odbc:DatabaseName
在各个database下怎么写
二、jdbc
database:
sqlserver7/sqlserver2000
oracle 8i
mysql
db2
在各个database下,该用什么jdbc driver,classpath该怎样写
那位高手为大家做点贡献吧,新版主帮大家做点实事,
总结一下用java连接database问题,省的大家老问,也方便查询:
一、jdbc-odbc
database:
sqlserver7/sqlserver2000
oracle 8i
mysql
db2
具体怎样连接,请具体到语句怎样写,如
sun.jdbc.odbc.JdbcOdbcDriver
jdbc:odbc:DatabaseName
在各个database下怎么写
二、jdbc
database:
sqlserver7/sqlserver2000
oracle 8i
mysql
db2
在各个database下,该用什么jdbc driver,classpath该怎样写
|
============ORACLE 8i============================
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@myhost:1521:orcl",
"scott", "tiger");
=============MySQL=================================
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://myhost:3306/dbname","user","passwd");
============InfoMax================================
Class.forName("com.informix.jdbc.IfxDriver");
conn = DriverManager.getConnection("jdbc:informix-sqli://myhost:1533:informixserver=myserver;user=rdtest;password=test");
Class.forName ("oracle.jdbc.driver.OracleDriver");
Connection conn =
DriverManager.getConnection ("jdbc:oracle:thin:@myhost:1521:orcl",
"scott", "tiger");
=============MySQL=================================
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection("jdbc:mysql://myhost:3306/dbname","user","passwd");
============InfoMax================================
Class.forName("com.informix.jdbc.IfxDriver");
conn = DriverManager.getConnection("jdbc:informix-sqli://myhost:1533:informixserver=myserver;user=rdtest;password=test");