Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void submit() {
- System.out.println("Test:" + buttonCounter);
- PreparedStatement preparedStatement = null;
- Connection connection = null;
- try {
- String connectionString = "jdbc:mysql://188.166.215.160:3306/isys3400?useSSL=false";
- connection = DriverManager.getConnection(connectionString, "application", "@ISYS3400project");
- preparedStatement = connection.prepareStatement(
- "INSERT INTO Tester (number) "
- + "VALUES (now(),?)");
- String number = buttonCounter;
- preparedStatement.setString(1, number);
- preparedStatement.executeUpdate();
- } catch (SQLException e) {
- System.out.println("SQLException: " + e.getMessage());
- System.out.println("SQLState: " + e.getSQLState());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement