Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String insertString = "INSERT INTO listings(Seller, Title, Close_Time, Price, Condition)"
- + " VALUES('"+par.getSellerName()+"', '"+par.getItemName()+"', "
- +closetime+", "+par.getPrice()+", '"+par.getCondition()+"')";
- pst = con.prepareStatement(insertString);
- pst.executeUpdate();
- ResultSet rs = pst.getGeneratedKeys();
- pst = con.prepareStatement(
- "INSERT INTO listings(Seller, Title, Close_Time, Price, Condition)"
- + "VALUES(?,?,?,?,?)", Statement.RETURN_GENERATED_KEYS);
- pst.setString(1, par.getSellerName());
- pst.setString(2, par.getItemName());
- long closeTime = getTimeMills(par.getTimeOver());
- pst.setLong(3, closeTime);
- pst.setDouble(4, par.getPrice());
- pst.setString(5, par.getCondition());
- pst = con.prepareStatement(insertString);
- pst.executeUpdate();
- ResultSet rs = pst.getGeneratedKeys();
Add Comment
Please, Sign In to add comment