mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 17:04:18 +01:00
feat(java): implement getBigDecimal() in JDBC4ResultSet
This commit is contained in:
@@ -408,7 +408,7 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
||||
@Override
|
||||
@SkipNullableCheck
|
||||
public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
|
||||
throw new UnsupportedOperationException("not implemented");
|
||||
return getBigDecimal(findColumn(columnLabel));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -631,4 +631,15 @@ class JDBC4ResultSetTest {
|
||||
assertTrue(resultSet.next());
|
||||
assertNull(resultSet.getCharacterStream(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
void test_getBigDecimal_with_columnLabel() throws Exception {
|
||||
stmt.executeUpdate("CREATE TABLE test_bigdecimal (amount REAL);");
|
||||
stmt.executeUpdate("INSERT INTO test_bigdecimal (amount) VALUES (12345.67);");
|
||||
|
||||
ResultSet resultSet = stmt.executeQuery("SELECT * FROM test_bigdecimal");
|
||||
assertTrue(resultSet.next());
|
||||
|
||||
assertEquals(BigDecimal.valueOf(12345.67), resultSet.getBigDecimal("amount"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user