@Implementation public Cursor query(boolean distinct, String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy, String limit) { String where = selection; if (selection != null && selectionArgs != null) { where = buildWhereClause(selection, selectionArgs); } String sql = SQLiteQueryBuilder.buildQueryString(distinct, table, columns, where, groupBy, having, orderBy, limit); ResultSet resultSet; try { Statement statement = connection.createStatement(DatabaseConfig.getResultSetType(), ResultSet.CONCUR_READ_ONLY); resultSet = statement.executeQuery(sql); } catch (SQLException e) { throw new RuntimeException("SQL exception in query", e); } SQLiteCursor cursor = new SQLiteCursor(null, null, null, null); shadowOf(cursor).setResultSet(resultSet,sql); return cursor; }