Code example for SQLException

Methods: getMessage

0
        } catch (JdbcSQLException e) {
            if (e.getMessage().contains("No data is available"))
                throw new android.database.sqlite.SQLiteDoneException("No data is available"); //if the query returns zero rows
            throw new RuntimeException(e);
        } catch (SQLException e) {
            if (e.getMessage().contains("ResultSet closed"))
                throw new android.database.sqlite.SQLiteDoneException("ResultSet closed,(probably, no data available)"); //if the query returns zero rows (SQLiteMap)
            throw new RuntimeException(e);
        } 
    } 
 
    @Implementation 
    public String simpleQueryForString() {
        ResultSet rs;
        try { 
            rs = actualDBstatement.executeQuery();
            rs.next();
            return rs.getString(1);
        } catch (JdbcSQLException e) {
            if (e.getMessage().contains("No data is available"))
Contextual code suggestions in your IDE  Get Codota for Java