Advertisement
Guest User

Untitled

a guest
Jun 9th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. import java.io.File;
  2. import java.io.FileNotFoundException;
  3. import java.sql.*;
  4. import java.util.Scanner;
  5.  
  6. /**
  7. * Created by Darryl on 2017-06-10.
  8. */
  9. public class RFID {
  10.  
  11. public static void main(String[] args) throws FileNotFoundException {
  12. RFID rfid = new RFID();
  13. }
  14.  
  15. public RFID() throws FileNotFoundException {
  16. Scanner in = new Scanner(new File("id.txt"));
  17. String id = in.next();
  18. try {
  19. if (id != "") {
  20. String url = "jdbc:mysql://74.220.219.118:3306/kkmonlee_rubicon";
  21. Class.forName("com.mysql.jdbc.Driver");
  22. Connection conn = DriverManager.getConnection(url, "kkmonlee_insert", "seatspace");
  23. Statement statement = conn.createStatement();
  24. String query = "UPDATE EventCheck Set Checkout=\"" + new java.sql.Date(System.currentTimeMillis()) + "\" WHERE RFID = \"" + id + "\"";
  25. System.out.println(query);
  26. statement.execute(query);
  27. }
  28. } catch (ClassNotFoundException e) {
  29. e.printStackTrace();
  30. } catch (SQLException e) {
  31. e.printStackTrace();
  32. }
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement