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

📄 auryselectdao.java

📁 功能是公安和学校的管理系统,用struts+hibernate+spring等匡架组成,在eclepse就能编译
💻 JAVA
字号:
package com.comingnet.bean;
import com.db.*;
import java.sql.*;
import java.util.*;
public class AurySelectDAO {
	Connection conn=null;
	PreparedStatement stmt=null;
	ResultSet rs=null;
	
	public AurySelectDAO()
	{
		
	}
	
	public ArrayList<AurySelect> getAuryList(String userclass,int xxbh)
	{
		ArrayList<AurySelect>  ary=new ArrayList<AurySelect>();
		AurySelect auryselect=null;
		String sqlStr="";
		if(userclass.equals("1"))
		{
			sqlStr="select jsxm,jsid,1 as userclass from m_teacher where xxbh=?";
		}else if(userclass.equals("2"))
		{
			sqlStr="select xsxm,xsid,2 as userclass from m_student where xxbh=?";
		}
		try
		{
            conn=DBUtils.getConnection();
            stmt=conn.prepareStatement(sqlStr);
            stmt.setInt(1,xxbh);
            rs=stmt.executeQuery();
            while(rs.next())
            {
            	auryselect=new AurySelect();
            	auryselect.setUserxm(rs.getString(1));
            	auryselect.setUserid(rs.getInt(2));
            	auryselect.setUserclass(rs.getString(3));
            	ary.add(auryselect);
            }
		}catch(Exception e)
		{
			System.out.println("AurySelectDAO:"+e);
		}finally
		{
			DBUtils.closeResultSet(rs);
			DBUtils.closeStatement(stmt);
			DBUtils.closeConnection(conn);
		}
		return ary;
	}

}

⌨️ 快捷键说明

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