⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 databasecommmgr.java

📁 java阿里巴巴代码
💻 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 + -