200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > mysql数据库的链接地址_常用数据库连接URL地址大全

mysql数据库的链接地址_常用数据库连接URL地址大全

时间:2023-11-08 17:06:00

相关推荐

mysql数据库的链接地址_常用数据库连接URL地址大全

1、Oracle8/8i/9i数据库(thin模式)

Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

Stringurl="jdbc:oracle:thin:@localhost:1521:orcl";

//orcl为数据库的SID

Stringuser="test";

Stringpassword="test";

Connectionconn=DriverManager.getConnection(url,user,password);

2、DB2数据库

Class.forName("com.ibm.db2.jdbc.app.DB2Driver").newInstance();

Stringurl="jdbc:db2://localhost:5000/sample";

//sample为你的数据库名

Stringuser="admin";

Stringpassword="";

Connectionconn=DriverManager.getConnection(url,user,password);

3、SqlServer7.0/2000数据库

Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

Stringurl="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb";

//mydb为数据库

Str

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。