Answers for "fun ResultSet.getLongOrNull(columnName: String) = try { this.getLong(columnName) } catch (e: Exception) { null }"

1

jdbc ResultSet test null

int iVal = 0;
ResultSet rs = magicallyAppearingStmt.executeQuery(query);
if (rs.next()) {
    iVal = rs.getInt("ID_PARENT");
    if (rs.wasNull()) {
        // handle NULL field value
    }
}
Posted by: Guest on July-23-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language