Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.sql.*;
- import java.util.Scanner;
- /**
- * Created by Darryl on 2017-06-10.
- */
- public class RFID {
- public static void main(String[] args) throws FileNotFoundException {
- RFID rfid = new RFID();
- }
- public RFID() throws FileNotFoundException {
- Scanner in = new Scanner(new File("id.txt"));
- String id = in.next();
- try {
- if (id != "") {
- String url = "jdbc:mysql://74.220.219.118:3306/kkmonlee_rubicon";
- Class.forName("com.mysql.jdbc.Driver");
- Connection conn = DriverManager.getConnection(url, "kkmonlee_insert", "seatspace");
- Statement statement = conn.createStatement();
- String query = "UPDATE EventCheck Set Checkout=\"" + new java.sql.Date(System.currentTimeMillis()) + "\" WHERE RFID = \"" + id + "\"";
- System.out.println(query);
- statement.execute(query);
- }
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement