Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public List <CollectibleMasterBean> getAllCollectibleMasterByCategory(int categoryid) throws SQLException {
- System.out.println(" ++++++++++++++++++++++++++ ");
- db = new DataBaseConnection();
- Connection con = db.getConnection();
- List <CollectibleMasterBean> listy = new ArrayList<CollectibleMasterBean>();
- PreparedStatement PS =
- con.prepareStatement("SELECT * FROM cabbagedb.collectiblemaster WHERE collectiblemaster.collectiblecategory_id=?");
- PS.setInt(1, categoryid);
- PS.execute();
- ResultSet RS = PS.getResultSet();
- while (RS.next()) {
- int TestCMCID = RS.getInt("collectiblemaster.collectiblecategory_id");
- if ((TestCMCID <= 0) || (TestCMCID >= 4)) {
- System.out.println("Warning - Warning - Warning - Category ID " + TestCMCID + " does not exist.");
- }
- else {
- int CMID = RS.getInt("collectiblemaster.collectiblemaster_id");
- int CMIID = RS.getInt("collectiblemaster.item_id");
- int CMSID = RS.getInt("collectiblemaster.skill_id");
- int CMFID = RS.getInt("collectiblemaster.faculty_id");
- String CMCN = RS.getString("collectiblemaster.name");
- int CMCID = RS.getInt("collectiblemaster.collectiblecategory_id");
- String CMCD = RS.getString("collectiblemaster.description");
- String CMCIN = RS.getString("collectiblemaster.imagefilename");
- CollectibleMasterBean CMB = new CollectibleMasterBean(CMID,CMIID,CMSID,CMFID,CMCN,CMCID,CMCD,CMCIN);
- listy.add(CMB);
- }
- }
- System.out.println(" ++++ Here I am - I made it. Now why wont I work? ++++ ");
- con.close();
- return listy;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement