Skip to content

Commit

Permalink
Revert "Small changes"
Browse files Browse the repository at this point in the history
This reverts commit c348e20.
  • Loading branch information
bowbahdoe committed Feb 27, 2024
1 parent c348e20 commit 9206c61
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/main/java/dev/mccue/jdbc/ResultSets.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,4 +474,21 @@ public static Double getDoubleNullable(ResultSet rs, int index) throws SQLExcept
}
return value;
}

/**
* Gets a double value from a {@link ResultSet}, returning null
* if the column is null.
*
* @param rs The {@link ResultSet}
* @param columnName The column to get.
* @return A double value
* @throws SQLException If the driver throws an exception.
*/
public static Double getDoubleNullable(ResultSet rs, String columnName) throws SQLException {
var value = rs.getDouble(columnName);
if (rs.wasNull()) {
return null;
}
return value;
}
}
2 changes: 1 addition & 1 deletion src/main/java/dev/mccue/jdbc/StatementPreparer.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public PreparedStatement process(StringTemplate stringTemplate) throws SQLExcept
var params = new ArrayList<SettableParameter>();
var strings = new StringBuilder();

for (int i = 0; i < valuesSize; i++) {
for (int i = 0; i < valuesSize; ++i) {
strings.append(fragments.get(i));
var value = values.get(i);
switch (value) {
Expand Down

0 comments on commit 9206c61

Please sign in to comment.