Advertisement
Walkerbo

Ooooh yeah

Sep 4th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. public List <LeaderBoardBean> getLeaderBoardBeans() throws SQLException {          
  2.        
  3.         db = new DataBaseConnection();
  4.         Connection con = db.getConnection();
  5.        
  6.         List <LeaderBoardBean> TLBBL = new ArrayList<LeaderBoardBean>();       
  7.        
  8.         PreparedStatement PS =
  9.                 con.prepareStatement("SELECT account.username,player.player_id,collectiblecategory.value" +
  10.                         "INNER JOIN cabbage.player" +
  11.                         "ON account.account_id=player.account_id" +
  12.                         "INNER JOIN cabbage.collected" +
  13.                         "ON player.collected_id=collected.collected_id" +
  14.                         "INNER JOIN cabbage.livecollectible" +
  15.                         "ON collected.livecollectible_id=livecollectible.livecollectible_id" +
  16.                         "INNER JOIN cabbage.collectiblemaster" +
  17.                         "ON livecollectible.collectiblemaster_id=collectiblemaster.collectiblemaster_id" +
  18.                         "INNER JOIN cabbage.collectiblecategory" +
  19.                         "ON collectiblemaster.collectiblecategory_id=collectiblecategory.collectiblecategory_id");
  20.        
  21.         PS.execute();
  22.        
  23.         ResultSet RS = PS.getResultSet();      
  24.        
  25.         if (RS.next()) {
  26.            
  27.             String UN = RS.getString("account.username");
  28.             int PID = RS.getInt("player.player_id");
  29.             int P = RS.getInt("collectiblecategory.value");
  30.            
  31.             LeaderBoardBean LBB = new LeaderBoardBean(UN,PID,P);
  32.            
  33.             System.out.println(LBB.toString());
  34.            
  35.             TLBBL.add(LBB);    
  36.            
  37.         }
  38.         return TLBBL;
  39.        
  40.    
  41.    
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement