Chinaunix首页 | 论坛 | 博客
  • 博客访问: 92408508
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Mysql/postgreSQL

2008-05-24 21:21:16

   来源: 作者:wanchao2001的 Blog  

">

//SQL_Server:

String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=test";
String user = "sa";
String password = "";


//Oracle:

String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:wanchao";
String user = "scott";
String password = "tiger";


//mysql
String driver="com.mysql.jdbc.Driver";
String url="jdbc:mysql://localhost:3306/chinabank?useUnicode=true&characterEncoding=GBK";
String user="root";
String passeord="root";

Class.forName(driver);
con = DriverManager.getConnection(url,user,password);

阅读(463) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~