Description:
I am using a Statement object to perform an update with code like the following:
update player set at_bats=5 and runs=3 and outs=3 where player_id=3
in the database, the first column in the set clause is always being set to the value 1, meaning with the code above, the at_bats for player_id 3 is being set to 1 as opposed to the value 5. If I change around the SQL and make it:
update player set runs=3 and at_bats=5 and outs=3 where player_id=3
then the column runs gets updated with a value of 1.
I just downloaded the newest stable version of the driver 3.0.11 and I got the same results.
How to repeat:
code snipplet:
String sqlUpdate="update hit_stat set "
+ "hits='" + hs.getHits() + "' and "
+ "at_bats='" + hs.getAtBats() + "' and "
+ "runs='" + hs.getRuns() + "' and "
+ "doubles='" + hs.getDoubles() + "' and "
+ "triples='" + hs.getTriples() + "' and "
+ "hr='" + hs.getHomeRuns() + "' and "
+ "rbi='" + hs.getRunsBattedIn() + "' and "
+ "walks='" + hs.getWalks() + "' and "
+ "sacs='" + hs.getSacs() + "' and "
+ "hbp='" + hs.getHitByPitch() + "' and "
+ "roe='" + hs.getReachedOnError() + "' and "
+ "so='" + hs.getStrikeOuts() + "' and "
+ "sb='" + hs.getStolenBases() + "' and "
+ "cs='" + hs.getCaughtStealing() + "' "
+ "where "
+ "player_id='" + hs.getPlayerId() + "' and "
+ "game_id='" + hs.getGameId() + "' and "
+ "season_id='" + hs.getSeasonId() + "' and "
+ "team_id='" + hs.getTeamId() + "' and "
+ "stat_typ='" + hs.getStatType() + "';";
conn = getConnection();
stmt = conn.createStatement();
stmt.executeUpdate(sqlUpdate);
Description: I am using a Statement object to perform an update with code like the following: update player set at_bats=5 and runs=3 and outs=3 where player_id=3 in the database, the first column in the set clause is always being set to the value 1, meaning with the code above, the at_bats for player_id 3 is being set to 1 as opposed to the value 5. If I change around the SQL and make it: update player set runs=3 and at_bats=5 and outs=3 where player_id=3 then the column runs gets updated with a value of 1. I just downloaded the newest stable version of the driver 3.0.11 and I got the same results. How to repeat: code snipplet: String sqlUpdate="update hit_stat set " + "hits='" + hs.getHits() + "' and " + "at_bats='" + hs.getAtBats() + "' and " + "runs='" + hs.getRuns() + "' and " + "doubles='" + hs.getDoubles() + "' and " + "triples='" + hs.getTriples() + "' and " + "hr='" + hs.getHomeRuns() + "' and " + "rbi='" + hs.getRunsBattedIn() + "' and " + "walks='" + hs.getWalks() + "' and " + "sacs='" + hs.getSacs() + "' and " + "hbp='" + hs.getHitByPitch() + "' and " + "roe='" + hs.getReachedOnError() + "' and " + "so='" + hs.getStrikeOuts() + "' and " + "sb='" + hs.getStolenBases() + "' and " + "cs='" + hs.getCaughtStealing() + "' " + "where " + "player_id='" + hs.getPlayerId() + "' and " + "game_id='" + hs.getGameId() + "' and " + "season_id='" + hs.getSeasonId() + "' and " + "team_id='" + hs.getTeamId() + "' and " + "stat_typ='" + hs.getStatType() + "';"; conn = getConnection(); stmt = conn.createStatement(); stmt.executeUpdate(sqlUpdate);