📄 mailboxinfor.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 + -