jameszhang
CJSDN高级会员
发贴: 1594
积分: 111
|
于 2003-08-13 11:28
连接Oracle8/8i/9i数据库(用thin模式)
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); String url="jdbc:oracle:thin:@localhost:1521:orcl";
------------------------------------------------------------------- 连接Sql Server7.0/2000数据库
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance(); String url="jdbc:microsoft: sqlserver://localhost:1433;DatabaseName=pubs";
------------------------------------------------------------------- 连接DB2数据库 Class.forName("com.ibm.db2.jdbc.app.DB2Driver ").newInstance(); String url="jdbc: db2://localhost:5000/sample"; ------------------------------------------------------------------- 连接Informix数据库 Class.forName("com.informix.jdbc.IfxDriver").newInstance(); String url ="jdbc:informix- sqli://123.45.67.89:1533/testDB:INFORMIXSERVER=myserver"; ------------------------------------------------------------------- 连接Sybase数据库
Class.forName("com.sybase.jdbc.SybDriver").newInstance(); String url =" jdbc:sybase:Tds:localhost:5007/tsdata";
------------------------------------------------------------------- 连接MySQL数据库
Class.forName("org.gjt.mm.mysql.Driver").newInstance(); String url ="jdbc: mysql://localhost/softforum" ; ------------------------------------------------------------------- 连接PostgreSQL数据库 Class.forName("org.postgresql.Driver").newInstance(); String url ="jdbc: postgresql://localhost/soft" ;
-------------------------------------------------------------------
why edited on 2003-08-13 15:04
"First they ignore u, then they laugh at u, then they fight u, then u will win
Mahatma Gandhi"
|