@Override public Void call(final SQLiteStatement statement) throws Exception { statement.reset(true); return null; } });
@Override public Object call() throws Exception { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); stmt.reset(true); return null; } });
@Override public Void call(final SQLiteStatement statement) throws Exception { statement.reset(true); return null; } });
/** * Convenience method that resets the statement and clears bindings. See {@link #reset(boolean)} for a detailed * description. * * @return this statement * @throws SQLiteException if SQLite returns an error, or if the call violates the contract of this class */ public SQLiteStatement reset() throws SQLiteException { return reset(true); }
@Override public Object call() throws Exception { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); stmt.reset(true); return null; } });
@Override public Void call(final SQLiteStatement statement) throws Exception { statement.reset(true); return null; } });
@Override public void beginWindow(long windowId) { try { beginStatement.step(); beginStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
@Override public void beginWindow(long windowId) { try { beginStatement.step(); beginStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
@Override public void processTuple(int tableNum, HashMap<String, Object> tuple) { InputSchema inputSchema = inputSchemas.get(tableNum); SQLiteStatement insertStatement = insertStatements.get(tableNum); try { for (Map.Entry<String, Object> entry : tuple.entrySet()) { ColumnInfo t = inputSchema.columnInfoMap.get(entry.getKey()); if (t != null && t.bindIndex != 0) { insertStatement.bind(t.bindIndex, entry.getValue().toString()); } } insertStatement.step(); insertStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
@Override public void processTuple(int tableNum, HashMap<String, Object> tuple) { InputSchema inputSchema = inputSchemas.get(tableNum); SQLiteStatement insertStatement = insertStatements.get(tableNum); try { for (Map.Entry<String, Object> entry : tuple.entrySet()) { ColumnInfo t = inputSchema.columnInfoMap.get(entry.getKey()); if (t != null && t.bindIndex != 0) { //System.out.println("Binding: "+entry.getValue().toString()+" to "+t.bindIndex); insertStatement.bind(t.bindIndex, entry.getValue().toString()); } } insertStatement.step(); insertStatement.reset(); } catch (SQLiteException ex) { throw new RuntimeException(ex); } }
@Override public void endWindow() { try { commitStatement.step(); commitStatement.reset(); if (bindings != null) { for (int i = 0; i < bindings.size(); i++) { execStatement.bind(i, bindings.get(i).toString()); } } int columnCount = execStatement.columnCount(); while (execStatement.step()) { HashMap<String, Object> resultRow = new HashMap<String, Object>(); for (int i = 0; i < columnCount; i++) { resultRow.put(execStatement.getColumnName(i), execStatement.columnValue(i)); } this.result.emit(resultRow); } execStatement.reset(); for (SQLiteStatement st : deleteStatements) { st.step(); st.reset(); } } catch (SQLiteException ex) { throw new RuntimeException(ex); } bindings = null; }
@Override public void endWindow() { try { commitStatement.step(); commitStatement.reset(); if (bindings != null) { for (int i = 0; i < bindings.size(); i++) { execStatement.bind(i, bindings.get(i).toString()); } } int columnCount = execStatement.columnCount(); while (execStatement.step()) { HashMap<String, Object> resultRow = new HashMap<String, Object>(); for (int i = 0; i < columnCount; i++) { resultRow.put(execStatement.getColumnName(i), execStatement.columnValue(i)); } this.result.emit(resultRow); } execStatement.reset(); for (SQLiteStatement st : deleteStatements) { st.step(); st.reset(); } } catch (SQLiteException ex) { throw new RuntimeException(ex); } bindings = null; }