Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bowbahdoe committed Feb 25, 2024
1 parent b999328 commit 0b85eeb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ void main() throws Exception {
""")) {
var rs = stmt.executeQuery();

// Methods exist for all 8 primitives
// Methods exist for all primitives except char
// (which doesn't have a method on ResultSet)
var number = ResultSets.getIntegerNullable(rs, "number");
}
}
Expand Down Expand Up @@ -165,7 +166,8 @@ void main() throws Exception {
""")) {
var rs = stmt.executeQuery();

// Methods exist for all 8 primitives
// Methods exist for all primitives except char
// (which doesn't have a method on ResultSet)
var number = ResultSets.getIntegerNotNull(rs, "number");
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/dev/mccue/jdbc/ResultSets.java
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public static Float getFloatNullable(ResultSet rs, String columnName) throws SQL
public static double getDoubleNotNull(ResultSet rs, int index) throws SQLException {
var value = rs.getDouble(index);
if (rs.wasNull()) {
throw new SQLException("Column " + index + " was null");
throw new SQLException(STR."Column \{index} was null");
}
return value;
}
Expand All @@ -453,7 +453,7 @@ public static double getDoubleNotNull(ResultSet rs, int index) throws SQLExcepti
public static double getDoubleNotNull(ResultSet rs, String columnName) throws SQLException {
var value = rs.getDouble(columnName);
if (rs.wasNull()) {
throw new SQLException("Column " + columnName + " was null");
throw new SQLException(STR."Column \{columnName} was null");
}
return value;
}
Expand Down

0 comments on commit 0b85eeb

Please sign in to comment.