日期:2014-05-20  浏览次数:20745 次

有段代码不知道哪里有错误请赐教
package   jihe.jiheinfo;
import   java.sql.*;
import   java.text.SimpleDateFormat;
import   java.util.ArrayList;
import   java.util.Calendar;
import   java.util.List;

public   class   Score   {

public   int   Ids;
      int   a,b,c,d;
        int   UserId;
String   Today;
String   Lastday;
DBconn   db=new   DBconn();
List   score_max=new   ArrayList();

public   void   time(){
  Calendar   today=Calendar.getInstance();
  SimpleDateFormat   sdf=new   SimpleDateFormat( "yyyy-MM-dd ");
  Today=sdf.format(today.getTime());

  today.add(Calendar.DATE,-60);
  Lastday=sdf.format(today.getTime());
 
}//时间方法
 
public   List   scores()   throws   SQLException,Exception{

String   SQL= "select   Id,count(Id)   as   Ids   from   Users     where   LastTimes   between   ' "+Lastday+ " '   and   ' "+Today+ " ' ";
ResultSet   rs=db.executeQuery(SQL);
while(rs.next()){
Ids=Integer.parseInt(rs.getString( "Ids "));
ScoreBean   sb=new   ScoreBean();
sb.setId(rs.getString( "Id "));
score_max.add(sb);

            }                  
return   score_max;
}//有多少人员处理


//查询表积分有3个方法
public   int   getC_score(int   UserId)  
                            throws   NumberFormatException,   SQLException   {
     
              String   SQL= "select   count(HostManId)   as   jifen   from   costumecomm   "   +
                              "where   HostManId= ' "+UserId+ " '   "   +
                        "and   Times   between   ' "+Lastday+ " '   and   ' "+Today+ " ' ";
           
                ResultSet   rs=db.executeQuery(SQL);
                while(rs.next()){
                              a=Integer.parseInt(rs.getString(1));
                                            }                
return   a;
        }    
 

public   int   getO_score(int   UserId)  
                          throws   NumberFormatException,   SQLException {

      String   SQL1= "select   count(HostManId)   as   jifen   from   ornamentcomm   "   +
                                              "where   HostManId= ' "+UserId+ " '   "   +