Skip to content

Commit

Permalink
Adopt C style of incrementing jdbc paramters
Browse files Browse the repository at this point in the history
  • Loading branch information
forus committed Jul 11, 2024
1 parent bc76d3b commit 0c0b754
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/mskcc/cbio/portal/dao/DaoCnaEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ public static void removeSampleCnaEvents(int cnaProfileId, List<Integer> sampleI
" WHERE sample_cna_event.`GENETIC_PROFILE_ID` = ? AND sample_cna_event.`SAMPLE_ID` IN (" +
String.join(",", Collections.nCopies(sampleIds.size(), "?"))
+ ")");
pstmt.setInt(1, cnaProfileId);
for (int i = 0; i < sampleIds.size(); i++) {
pstmt.setInt(i + 2, sampleIds.get(i));
int parameterIndex = 1;
pstmt.setInt(parameterIndex++, cnaProfileId);
for (Integer sampleId : sampleIds) {
pstmt.setInt(parameterIndex++, sampleId);
}
pstmt.executeUpdate();
} catch (SQLException e) {
Expand Down

0 comments on commit 0c0b754

Please sign in to comment.