哪位高手能给注释一下!!!! 我看不懂

来源:百度知道 编辑:UC知道 时间:2024/07/05 00:11:19
package operatedb;
import java.sql.Connection;
import java.sql.*;
public class Operate extends OpenDB
{
private Connection dbconn=super.getConnection();
private Statement stmt=null;//将其该位于处理的方法
//private PreparedStatement pstmt=null;
private ResultSet rs=null;
private int errNum=0;
private String errDesc="";
public boolean exeSqlUpdate(String strSql)
{
try
{
//pstmt=dbconn.prepareStatement(strSql);
//pstmt.executeUpdate();
stmt=dbconn.createStatement();
stmt.executeUpdate(strSql);
this.errNum=0;
return true;
}
catch(Exception ex)
{
this.errNum=-1;
this.errDesc=ex.toString();
return false;
}
}
public int getErrNum()
{
return errNum;
}
public String getErrDesc()

package operatedb; //文件打包到operatedb下

//导入需要的包
import java.sql.Connection;
import java.sql.*;
//定义一个类继承OpenDB
public class Operate extends OpenDB
{
//调用OpenDB的方法getConnection()返回一个Connection对象
private Connection dbconn=super.getConnection(); private Statement stmt=null;//将其该位于处理的方法
//private PreparedStatement pstmt=null;
private ResultSet rs=null; //定义一个结果集
private int errNum=0;
private String errDesc="";

//数据库更新方法
public boolean exeSqlUpdate(String strSql)
{
try
{
//pstmt=dbconn.prepareStatement(strSql);
//pstmt.executeUpdate();
stmt=dbconn.createStatement(); //获得操作对象
stmt.executeUpdate(strSql); //执行更新,具体内容看strSql
this.errNum=0;
return true;
}
catch(Exception ex)
{
this.errNum=-1;
this.errDesc=ex.toString(); //将异常信息赋给errDesc字符串
return false;
}
}
//返回errNum
public int getErrNu