My Insert is failing via preparedStatment, I've run the statement through MySQL manually and it works, and I've double checked my params, but it's failing when run through the app.:
try {
myConn = DriverManager.getConnection(url, username, password);
preStmt = myConn.prepareStatement(
"Insert Into games(HomeTeamID, AwayTeamID, HomeTeamGoals, AwayTeamGoals, GameMonth, GameDay, GameYear, Overtime, Shootout)
Values(?, ?, ?, ?, '?', ?, ?, ?, ?);");
preStmt.setInt(1, game.getHomeID());
preStmt.setInt(2, game.getAwayID());
preStmt.setInt(3, game.getHomeGoals());
preStmt.setInt(4, game.getAwayGoals());
preStmt.setString(5, game.getGameMonth());
preStmt.setInt(6, game.getGameDay());
preStmt.setInt(7, game.getGameYear());
preStmt.setBoolean(8, game.isOvertime());
preStmt.setBoolean(9, game.isShootout());
preStmt.executeUpdate();
myConn.commit();
}
catch(SQLException sqlex) { // FAILING ON THIS CATCH
JOptionPane.showMessageDialog(null, "Error - Game Update Failed!\n\t-> SQL Error.");
}
I've scoured numerous docs online, but couldn't find any reason why it wouldn't work, and as mentioned, I run the same statement through MySQL with mock data, and it works...
Any suggestions?