【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“th_init_unit_sql.java”一文,供大家参考学习!
package swing;
import com.bwm.string.Str;
import com.zh.conpool.*;
import java.sql.Connection;
import java.sql.ResultSet;
public class th_init_unit_sql{
private String
sql="";
private ResultSet rs=null;
private int del=0;
private String delid="";
Condata con=new Condata();
Connection conn=null;
Str str=new Str();
public ResultSet toRs(){
sql="select * from tb_th_unit";
try{
con.getConnection();
rs=con.executeQuery(sql);
}catch(Exception eee){
System.out.println(eee.getMessage());
}
return rs;
}
public int toDel(String id){
this.delid=id;
try{
sql="delete from tb_th_unit where ID='"+delid+"'";
con.getConnection();
del=con.executeUpdate(sql);
}catch(Exception eee){
System.out.println(eee.getMessage());
}
return del;
}
public void close(){
try{
conn=null;
}catch(Exception e){
System.out.print("f1");
}
try{
con.close();
con=null;
}catch(Exception ee){
System.out.print("f");
}
}
}