package util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBHelper { public static final String driver="com.mysql.jdbc.Driver"; public static final String url="jdbc:mysql://localhost:3306/test"; public static final String username="root"; public static final String password="123456"; public static Connection con=null; static{ try { Class.forName(driver);//�õ�DriverManager�������潨������ʱʹ�� } catch (ClassNotFoundException e) { e.printStackTrace(); } } public static Connection getConnection(){ if(con==null){ try { con=DriverManager.getConnection(url,username,password);//��������,ʹ�õIJ�����������������������ַ��������� } catch (SQLException e) { e.printStackTrace(); } } return con; } }
最近下载更多
asddwh LV12
1月3日
zhtssss LV1
2023年7月4日
oracleanacarge LV5
2023年7月3日
mrcao95 LV2
2023年6月26日
女王不该在山炮村养花 LV8
2023年4月16日
李亮 LV19
2023年3月6日
Numpile LV3
2023年3月1日
poipoiiop LV8
2023年1月3日
000666 LV10
2022年12月23日
微信网友_6263159342649344 LV7
2022年12月15日
最近浏览更多
周青松197 LV1
3月7日
asddwh LV12
2023年12月29日
微信网友_6792227559149568
2023年12月24日
暂无贡献等级
颜菜菜 LV2
2023年12月23日
无名氏111 LV32
2023年11月14日
lyq6666666 LV5
2023年10月23日
jiemomo LV12
2023年10月19日
qq573914838 LV5
2023年10月14日
lwlwlwlw LV3
2023年9月25日
苏柒 LV10
2023年9月20日