class SqlDataSourceUtils {

    public static boolean isNotNullColumn(DatabaseMetaData metaData, String tableName,
                                          String columnName) throws SQLException {
        try (ResultSet rs = metaData.getColumns(null, null, tableName, columnName)) {
            if (!rs.next()) {
                throw new IllegalStateException("Did not find meta data for column '"
                    + columnName + "' while checking for not-null constraint");
            }

            int nullableCode = rs.getInt("NULLABLE");
            if (nullableCode == DatabaseMetaData.columnNoNulls) {
                return true;
            } else if (nullableCode == DatabaseMetaData.columnNullableUnknown) {
                ConsoleLogger.warning("Unknown nullable status for column '" + columnName + "'");
            }
        }
        return false;
    }

    private  SqlDataSourceUtils();

}