| Modifier and Type | Field and Description |
|---|---|
| public static final int | TYPE_UNKNOWN
Constant that indicates an unknown (or unspecified) SQL type. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static void | closeResultSet(ResultSet
the JDBC ResultSet to close (may be rs)null)Close the given JDBC ResultSet and ignore any thrown exception. |
| public static void | closeStatement(Statement
the JDBC Statement to close (may be stmt)null)Close the given JDBC Statement and ignore any thrown exception. |
| public static Object | Returns: the value objectis the ResultSet holding the data rs, int is the column index index)Retrieve a JDBC column value from a ResultSet, using the most appropriate value type. |
| public static String | Returns: The value if found, null if not foundresult set to check rs, String column name to check columnNameToCheck, Database database)Checks whether a result set has a column matching the specified column name. |
| public static boolean | Returns: whether the type is numericthe SQL type to be checked sqlType)Check whether the given SQL type is numeric. |
| public static Object | Returns: the single result objectthe result Collection (can be results)null)Return a single result object from the given Collection. |
| TYPE_UNKNOWN | back to summary |
|---|---|
| public static final int TYPE_UNKNOWN Constant that indicates an unknown (or unspecified) SQL type.
| |
| JdbcUtil | back to summary |
|---|---|
| public JdbcUtil() | |
| close | back to summary |
|---|---|
| public static void close(ResultSet rs, Statement stmt) | |
| closeResultSet | back to summary |
|---|---|
| public static void closeResultSet(ResultSet rs) Close the given JDBC ResultSet and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.
| |
| closeStatement | back to summary |
|---|---|
| public static void closeStatement(Statement stmt) Close the given JDBC Statement and ignore any thrown exception. This is useful for typical finally blocks in manual JDBC code.
| |
| getResultSetValue | back to summary |
|---|---|
| public static Object getResultSetValue(ResultSet rs, int index) throws SQLException Retrieve a JDBC column value from a ResultSet, using the most appropriate value type. The returned value should be a detached value object, not having any ties to the active ResultSet: in particular, it should not be a Blob or Clob object but rather a byte array respectively String representation. Uses the
| |
| getValueForColumn | back to summary |
|---|---|
| public static String getValueForColumn(ResultSet rs, String columnNameToCheck, Database database) throws SQLException Checks whether a result set has a column matching the specified column name. The column name is first changed to match the database format. E.g. an unquoted columnName in h2 will be converted to uppercase so the column name that is being checked for is really the uppercase version of the column name, | |
| isNumeric | back to summary |
|---|---|
| public static boolean isNumeric(int sqlType) Check whether the given SQL type is numeric.
| |
| requiredSingleResult | back to summary |
|---|---|
| public static Object requiredSingleResult(Collection<E> results) throws DatabaseException Return a single result object from the given Collection. Throws an exception if 0 or more than 1 element found.
| |