Code example for Statement

Methods: executeQuery

0
    } 
 
    private void setupCursor() throws Exception { 
        Statement statement = connection.createStatement(DatabaseConfig.getResultSetType(), ResultSet.CONCUR_READ_ONLY);
        String sql ="SELECT * FROM table_name;";
        resultSet = statement.executeQuery("SELECT * FROM table_name;");
        cursor = new SQLiteCursor(null, null, null, null);
        Robolectric.shadowOf(cursor).setResultSet(resultSet, sql);
    } 
 
    private void setupEmptyResult() throws Exception { 
        Statement statement = connection.createStatement();
        statement.executeUpdate("DELETE FROM table_name;");
 
        setupCursor(); 
    } 
 
    private void assertColumnNames(String[] columnNames) {
        assertThat(columnNames.length, equalTo(7));
        assertThat(columnNames[0], equalTo("id"));
        assertThat(columnNames[1], equalTo("name"));