介绍一些主流数据库的连接字,希望对你有些帮助
1.JDBC-ODBC桥
String strCon = "jdbc:odbc:JspSamples";
//window下系统数据库的驱动;
2.Microsoft SQL Server 2000/2005 数据库
String strCon = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=JspSamples";
//1433是SQL Server的默认端口,JspSamples指数据库名称,以下都是;
3.MySQL
String strCon = "jdbc:mysql://localhost:3306/JspSamples";
//3306是MySQL的默认端口;
4.Oracle8/8i/9i数据库
String strCon = "jdbc:oracle:this:@localhost:1521:JspSamples";
//this模式连接服务器,1521端口;
5.IBM DB2数据库
String strCon = "jdbc:db2://localhost:5000/JspSamples";
//5000默认端口;
6.Informix数据库
String strCon = "jdbc:informix-sqli://localhost:1533/JspSamples:INFORMIXSERVER=myserver;
user = testuer;password=testpassword";
//1533端口,testuer用户名,testpassword密码;
7.Sybase数据库
String strCon = "jdbc:sybase:Tds:localhost:5007/JspSamples";
8.PostgreSQL数据库
String strCon = "jdbc:postgresql://localhost:5432/JspSamples";
