package com.tushugl.DbUtil;
import java.sql.*;
public class Dbutil {
	public static Connection conn = null;
	
	public static Connection getConn() {
		try {
			Class.forName("com.mysql.jdbc.Driver");
		} catch (ClassNotFoundException e) {

			e.printStackTrace();
		}
		try {
			conn = DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/mydb", "root", "123456");
		} catch (SQLException e) {

			e.printStackTrace();
		}
		return conn;
	}

	public static void close() {
		try {
			if (conn != null) {
				conn.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
最近下载更多
yuanshun  LV7 2024年12月10日
asdfgvb  LV1 2024年12月3日
小小白123  LV1 2024年10月16日
微信网友_7043209210023936  LV1 2024年6月18日
xiaoyu111ewsd  LV4 2024年1月7日
taoshen95  LV16 2024年1月5日
我的心里面激动  LV1 2024年1月4日
Kaiaahh  LV2 2023年12月30日
微信网友_5986558820093952  LV4 2023年12月26日
lang嘻嘻嘻  LV1 2023年12月25日
最近浏览更多
付洋麟  LV5 4月23日
LLLlllAAAaaa  LV1 4月7日
2480047258  LV1 2024年12月10日
yuanshun  LV7 2024年12月10日
asdfgvb  LV1 2024年12月3日
小小白123  LV1 2024年10月16日
微信网友_7043209210023936  LV1 2024年6月18日
抹茶栗子奶砖 2024年6月12日
暂无贡献等级
郑郭辉 2024年6月3日
暂无贡献等级
yyhrhv  LV8 2024年6月3日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友