`
l_rui_ci
  • 浏览: 40200 次
  • 性别: Icon_minigender_1
  • 来自: 桂林
社区版块
存档分类
最新评论

链接MySQL的代码片断

    博客分类:
  • JAVA
阅读更多

public class DB {
public static Connection getConn() {
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/bbs", "root" , "root");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}

}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics