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

📄 mailboxinfor.java

📁 功能是公安和学校的管理系统,用struts+hibernate+spring等匡架组成,在eclepse就能编译
💻 JAVA
字号:
package com.comingnet.bean;
import com.db.*;
import java.sql.*;
public class MailBoxInfor {
	
	private Connection conn=null;
	private PreparedStatement stmt=null;
	ResultSet rs=null;
	private int mailcount=0;
	private int mailnoReadcount=0;
	private int maildx=0;
	
	
	public int getMailcount() {
		return mailcount;
	}
	public void setMailcount(int mailcount) {
		this.mailcount = mailcount;
	}
	public int getMaildx() {
		return maildx;
	}
	public void setMaildx(int maildx) {
		this.maildx = maildx;
	}
	public int getMailnoReadcount() {
		return mailnoReadcount;
	}
	public void setMailnoReadcount(int mailnoReadcount) {
		this.mailnoReadcount = mailnoReadcount;
	}
	
	
	public void getMailInfor(int ryid,String ryclass,int xxbh,int rywjj)
	{
	    try
	    {
	    	conn=DBUtils.getConnection();
	    	stmt=conn.prepareStatement("select count(*) from yjsj where ryid=? and ryclass=? and xxbh=?  and rywjj = ?");
	    	stmt.setInt(1,ryid);
	    	stmt.setString(2,ryclass);
	    	stmt.setInt(3,xxbh);
	    	stmt.setInt(4, rywjj) ;
	    	rs=stmt.executeQuery();
	    	if(rs.next())
	    	{
	    		mailcount=rs.getInt(1);	
	    	}
	    	DBUtils.closeStatement(stmt);
	    	
	    	stmt=conn.prepareStatement("select count(*) from yjsj where ryid=? and ryclass=? and xxbh=?  and ryydbz='0' and rywjj=?");
	    	stmt.setInt(1,ryid);
	    	stmt.setString(2,ryclass);
	    	stmt.setInt(3,xxbh);
	    	stmt.setInt(4, rywjj) ;
	    	rs=stmt.executeQuery();
	    	if(rs.next())
	    	{
	    		mailnoReadcount=rs.getInt(1);	
	    	}
	    	DBUtils.closeStatement(stmt);
	    	
	    	stmt=conn.prepareStatement("select sum(DATALENGTH(yjnr)) as yjdx from yjsj a,yjxx b where  a.yjid=b.yjid  and  a.ryid=? and ryclass=? and xxbh=? and a.rywjj=?");
	    	stmt.setInt(1,ryid);
	    	stmt.setString(2,ryclass);
	    	stmt.setInt(3,xxbh);
	    	stmt.setInt(4, rywjj) ;
	    	rs=stmt.executeQuery();
	    	if(rs.next())
	    	{
	    		maildx=rs.getInt(1);	
	    	}
	    	DBUtils.closeStatement(stmt); 
	    	
	    }catch(Exception e)
	    {
	    	System.out.println(e);
	    }finally
	    {
	    	DBUtils.closeResultSet(rs);
	    	DBUtils.closeStatement(stmt);
	    	DBUtils.closeConnection(conn);
	    }
	}
}

⌨️ 快捷键说明

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