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

📄 mailaddrselect.java

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

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.HashMap;
import java.util.Map;

import com.db.DBUtils;

public class MailAddrSelect {
	Connection conn=null;
	PreparedStatement stmt=null;
	ResultSet rs=null;
	public MailAddrSelect()
	{
		
	}
	public Map getMailAddrInfor(int xxid,int userid,int fzlbid)
	{
		String sqlStr=""; 
		Map mailAddrInfor = new HashMap();
		try
		{
			conn=DBUtils.getConnection();
			if(fzlbid==0)
				
			{
				System.out.println("xxid"+xxid) ;
				sqlStr="select b.id as id,b.yjzh as yjzh,b.yjlxr as yjlxr from txl_lb a,txl_xx b where (a.fzlbid = b.lb_id and a.ryid= '"+userid+"' and a.xxid='"+xxid+"' ) or (a.ryid=0 and a.xxid=0 and a.fzlbid=b.lb_id)";
			}else
			{
				sqlStr="select b.id as id,b.yjzh as yjzh,b.yjlxr as yjlxr from txl_lb a,txl_xx b where (a.fzlbid = b.lb_id and a.fzlbid='"+fzlbid+"' and a.ryid= '"+userid+"' and a.xxid='"+xxid+"' ) or (a.ryid=0 and a.xxid=0 and a.fzlbid=b.lb_id and a.fzlbid='"+fzlbid+"')";
			}
			stmt=conn.prepareStatement(sqlStr);
			rs=stmt.executeQuery();
			while(rs.next())
			{
				mailAddrInfor.put(rs.getString("yjzh"),rs.getString("yjlxr"));				
			}
		}catch(Exception e)
		{
			System.out.println("DWR:"+e);
		}finally
		{
			DBUtils.closeResultSet(rs);
			DBUtils.closeStatement(stmt);
			DBUtils.closeConnection(conn);
		}
		return mailAddrInfor;
	}
}

⌨️ 快捷键说明

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