package com.rjxy.dao; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class DAO { protected Connection conn; protected PreparedStatement pst; protected ResultSet rs; protected int rs2; public DAO(){ this.lian(); } public void lian(){ try { Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); conn=DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DataBaseName=company","hehe","123456"); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } } public void select(String sql ,Object[] param){ try { pst=conn.prepareStatement(sql); if(param !=null){ for(int i=0;i<param.length;i++){ pst.setObject(i+1, param[i]); } } rs=pst.executeQuery(); } catch (SQLException e) { e.printStackTrace(); } } public void ZSG(String sql ,Object[] param){ try { pst=conn.prepareStatement(sql); if(param !=null){ for(int i=0;i<param.length;i++){ pst.setObject(i+1, param[i]); } } rs2=pst.executeUpdate(); } catch (SQLException e) { e.printStackTrace(); } } public void guan(){ try { if(rs!=null){ rs.close(); } if(pst !=null){ pst.close(); }if(conn !=null){ conn.close(); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }

张德志 LV9
2024年6月14日
微信网友_6517899564732416 LV1
2023年6月13日
123djdb LV1
2023年4月28日
wangyunhao LV10
2022年5月11日
微信网友_5952536837984256 LV2
2022年5月10日
库里南 LV2
2022年4月1日
zhuohanyuan LV10
2021年12月30日
knklan LV8
2021年12月22日
项新诚 LV1
2021年10月18日
202025040131 LV1
2021年6月30日

214liujianchen LV4
6月16日
zongbaoli LV2
2月23日
cassie555 LV3
1月21日
张泽帅 LV6
2024年10月18日
15719908287 LV10
2024年6月19日
张德志 LV9
2024年6月14日
pangzhihui LV14
2024年4月15日
wangsheng818 LV4
2024年4月8日
heshao LV2
2024年2月7日
ljfydm LV2
2023年10月15日