Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean CheckGE(Client clientToSave, String DB, String input, String whatisit, boolean PRINTGEUPDATE) {
- boolean sold = false;
- try {
- Connection C = DriverManager.getConnection("jdbc:mysql://localhost/access","root","ascent");
- Statement Stmt = C.createStatement();
- ResultSet RS = stmt.executeQuery("SELECT * " +
- "FROM "+DB+" WHERE seller=\""+input+"\" AND itemstatus=\""+whatisit+"\" AND itemid AND id");
- while (RS.next()) {
- String str1 = RS.getString("seller");
- String str2 = RS.getString("itemid");
- String str3 = RS.getString("price");
- String str4 = RS.getString("id");
- String str5 = RS.getString("itemstatus");
- if(str1.equalsIgnoreCase(input)){
- if(PRINTGEUPDATE){
- clientToSave.sendMessage("@dbl@Check your grand exchange it has been updated!");
- }
- sold = true;
- }
- }
- RS.close();
- Stmt.close();
- C.close();
- }
- catch (SQLException E) {
- System.out.println("SQLException: " + E.getMessage());E.printStackTrace();
- System.out.println("SQLState: " + E.getSQLState());
- System.out.println("VendorError: " + E.getErrorCode());
- return false;
- }
- return sold;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement