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

📄 inseronlineuser.java

📁 功能是公安和学校的管理系统,用struts+hibernate+spring等匡架组成,在eclepse就能编译
💻 JAVA
字号:
package com.comingnet.bean;
import com.db.DBUtils;
import com.db.ProxoolAction;
import java.sql.*;

import org.apache.commons.logging.*;

public class InserOnlineUser {
	
	private static final Log logger = LogFactory.getLog(InserOnlineUser.class);
	
	public InserOnlineUser()
	{
		
	}
	public void  insertZXB(String sqlStr)
	{
		Connection conn=null;
		PreparedStatement stmt=null;
		try
		{
           conn=ProxoolAction.getConnection();
		   stmt=conn.prepareStatement(sqlStr);
           stmt.executeUpdate();
           stmt.close();
           logger.info("向在线表中插入数据:"+sqlStr);
		}catch(Exception e)
		{
		    logger.error("向在线表插入数据异常",e);
		}finally
		{
			ProxoolAction.closeStatement(stmt);
			ProxoolAction.closeConnection(conn);
		} 
	}
    
	public void deleteZXB(String username)
	{
		Connection conn=null;
		PreparedStatement stmt=null;
		try
		{ 
		   conn=ProxoolAction.getConnection();
		   stmt=conn.prepareStatement("delete from xtzxb where zxzh=?");
           stmt.setString(1,username);
           stmt.executeUpdate();
           stmt.close();
           logger.info("删除在线表中的数据:"+username);
		}catch(Exception e)
		{
		    logger.error("删除在线表数据出现异常",e);	
		}finally
		{
			ProxoolAction.closeStatement(stmt);
			ProxoolAction.closeConnection(conn);
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -