首页>代码>java swing开发最简单的图书管理系统>/Tushuchaxun/src/demo/database.java
package demo;

import java.sql.*;

public class database {
	String url;
	String name;
	String pwd;
	String driverName;

	public database() {
		url = "jdbc:mysql://127.0.0.1:3306/mybookshop";
		name = "root";
		pwd = "123456";
		driverName = "com.mysql.jdbc.Driver";
		try {
			Class.forName(driverName);// 속潼혜땡
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	// 돤돕젯쌈
	public Connection getConnection() {
		try {
			return DriverManager.getConnection(url, name, pwd);// 쉔접鑒앴욋젯쌈

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		// TODO Auto-generated method stub
		return null;
	}

	public void CloseConnection(Connection con) {
		try {
			con.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
最近下载更多
孤峰远影  LV2 2023年12月20日
768881787  LV7 2023年12月20日
微信网友_6445756515635200  LV3 2023年12月18日
李朝磊  LV18 2023年12月3日
hongdongdong  LV14 2023年8月9日
微信网友_6431017932869632  LV1 2023年4月13日
ma2519096  LV1 2022年11月26日
你们的代码都是我的了  LV16 2022年11月13日
微信网友_6017665021366272  LV1 2022年6月25日
1719863922  LV11 2022年6月13日
最近浏览更多
chengjingjingjing 6月17日
暂无贡献等级
15592940706  LV3 6月16日
曾纪荣 3月2日
暂无贡献等级
pxqtsht  LV16 2月21日
无异偶  LV3 2024年12月30日
momomo228  LV2 2024年11月22日
233002037  LV3 2024年10月20日
dnuygwqudyg 2024年6月28日
暂无贡献等级
xzw135246789  LV1 2024年6月15日
微信网友_6808953284677632  LV2 2024年6月5日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友