诡异问题之一
下面是一段分页的代码:
public Vector getContents(double eachNum,int pageNum,String tabName,String[] fids,String condition,String jspName)
{
Vector contents=new Vector();
int max=pageNum*(int)eachNum;
int min=(pageNum-1)*(int)eachNum;
String s= " ";
try
{
DBConnect db=new DBConnect();
Connection conn=db.getConn();
Statement stmt2=conn.createStatement();
ResultSet rs2=stmt2.executeQuery( "select count(*) from "+tabName+ " "+condition);
rs2.next();
int totalNum=rs2.getInt(1);
rs2.close();
stmt2.close();
totalPageNum=1;
if (totalNum/eachNum> (int)(totalNum/eachNum))
{