Skip to content

Change this logic #197

@brendangoldberg

Description

@brendangoldberg

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();
		}
	}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions