java常用查询笔记.docVIP

  • 7
  • 0
  • 约3.28万字
  • 约 31页
  • 2017-11-17 发布于河南
  • 举报
java常用查询笔记

数据库JDBC连接 1.Oracle9i数据库(用thin模式) Class.forName(oracle.jdbc.driver.OracleDriver).newInstance(); String url = jdbc:oracle:thin:@localhost:1521:DMC; //localhost为主机名,1521为端口号,DMC为数据库的SID String user=cx; String password=123; Connection conn = DriverManager.getConnection(url,user,password); 2.MySQL数据库 Class.forName(com.mysql.jdbc.Driver).newInstance(); String url = jdbc:mysql://localhost/DMC?user=cxpassword=123useUnicode=true characterEncoding=gb2312; //localhost为主机名,DMC为数据库名 Connection conn = DriverManager.getConnection(url); 3.Sql Server2000数据库 Class.forName(com.micros

文档评论(0)

1亿VIP精品文档

相关文档