|
public void updateTie(String tname, String tnname) { |
Please use something like this instead, because you already know the two team names, and it will always be two teams, this reduces the complexity a lot.
public void updateTie() {
String query = "select * from TEAM_TABLE where uid = \"gold\" or uid = \"green\"";
try(Connection conn = DriveManager.getConnection(db, user, password);
PreparedStatement statement = conn.preparedStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE)) {
ResultSet rs = statement.executeQuery();
while (rs.next()) {
rs.updateInt("tie_count", (rs.getInt("tie_count") + 1));
}
} catch(SQLException e) {
e.printStackTrace();
}
}
Blue-Team/DB/src/main/java/csc480/blue/db/QueryClass.java
Line 1150 in 1959d8b
Please use something like this instead, because you already know the two team names, and it will always be two teams, this reduces the complexity a lot.