?? databasecommmgr.java
字號:
/*
* Created on 2006-6-18
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.ahbay.commenMgr;
import com.ahbay.DataBaseMgr.*;
import java.sql.*;
/**
* @author: Wangrc
* @Date: 2006-6-18 20:49:14
* @Method Name:
*/
public class DataBaseCommMgr
{
public DataBaseCommMgr(){}
private String strQuery;
private Connection ConnectionHandle;
/**
* Returns the rsrv_str4.
* @return String
*/
public String getStrQuery()
{
return strQuery;
}
/**
* Set the rsrv_str4.
* @param rsrv_str4 The rsrv_str4 to set
*/
public void setStrQuery(String strQuery)
{
this.strQuery = strQuery;
}
/**
*
* @author: Wangrc
* @Date: 2006-6-18 20:44:46
* @Method Name: ExecInsert
*/
public String ExecBizQuery()
{
this.ConnectionHandle=null;
DataBaseConn ThisConn=new DataBaseConn();
this.ConnectionHandle =ThisConn.GetConnection();
Statement stm;
try
{
stm=this.ConnectionHandle.createStatement();
stm.executeUpdate(this.strQuery);
this.ConnectionHandle.commit();
}
catch (SQLException e)
{
return e.getMessage()+"||"+this.strQuery;
}
catch (Exception e)
{
return e.getMessage()+"||"+this.strQuery;
}
CloseConn();
return "1";
}
/**
* @author: 王仁超
* @Date: 2005-7-13
* @Method Name: CloseConn
*/
public void CloseConn()
{
try
{
this.ConnectionHandle.close();
}
catch (SQLException e)
{
System.out.println("SQLERROR:"+e.getMessage());
}
}
/**
*
* @author: Wangrc
* @Date: 2006-6-18 20:44:46
* @Method Name: SelBizQuery
*/
public ResultSet SelBizQuery()
{
this.ConnectionHandle=null;
DataBaseConn ThisConn=new DataBaseConn();
this.ConnectionHandle =ThisConn.GetConnection();
Statement stm;
ResultSet rst = null;
try
{
stm = this.ConnectionHandle.createStatement();
rst = stm.executeQuery(this.strQuery);
}
catch (SQLException e)
{
System.out.println("SQLERROR:"+e.getMessage());
}
return rst;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -