输入banner图图片脚本导航/分类

java 连接mysql 和sql server2008代码

Class.forName("com.mysql.jdbc.Driver").newInstance();

String url="jdbc:mysql://localhost:3306/website?characterEncoding=utf8";//website为数据库名。读取mysql中中文字符

String user="root";//登录mysql的username和password

String pwd="123456";

con=DriverManager.getConnection(url,user,pwd);


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

String url="jdbc:sqlserver://localhost:1433;DatabaseName=website";   

String user="sa";//登录sql server的username和password

String pwd="123456";

con=DriverManager.getConnection(url,user,pwd);


java 连接mysql 和sql server2008代码

标签:成功   msu   tco   min   mysql   rgb   style   color   url