@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
public String columnString(String columnName) throws SQLiteException { return this.stmt.columnString(sqliteQuery.getColumnIndex(columnName)); }
public String columnString(String columnName) throws SQLiteException { return this.stmt.columnString(sqliteQuery.getColumnIndex(columnName)); }
@Override public String call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnString(0); } });
@Override public String call() throws SQLiteException { SQLiteStatement stmt = stmt(connectionPtr, statementPtr); if (!stmt.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return stmt.columnString(0); } });
@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
@Override public String call(final SQLiteStatement statement) throws Exception { if (!statement.step()) { throw new SQLiteException(SQLiteConstants.SQLITE_DONE, "No rows returned from query"); } return statement.columnString(0); } });
public String extractSingleString() throws SQLiteException { this.stmt.step(); String result = this.stmt.columnString(0); this.dispose(); return result; }
public String extractSingleString() throws SQLiteException { this.stmt.step(); String result = this.stmt.columnString(0); this.dispose(); return result; }
public String[] extractStrings(int bufferLength) throws SQLiteException { if (this.isStatementDisposed() == false) { String[] buffer = new String[bufferLength]; // Iterate over each record int idx = 0; while (this.stmt.step()) { buffer[idx] = this.stmt.columnString(0); idx++; } // Dispose the statement this.dispose(); return Arrays.copyOfRange(buffer, 0, idx - 1); } else { return new String[0]; } }
public String[] extractStrings(int bufferLength) throws SQLiteException { if (this.isStatementDisposed() == false) { String[] buffer = new String[bufferLength]; // Iterate over each record int idx = 0; while (this.stmt.step()) { buffer[idx] = this.stmt.columnString(0); idx++; } // Dispose the statement this.dispose(); return Arrays.copyOfRange(buffer, 0, idx - 1); } else { return new String[0]; } }
st.step(); if (st.hasRow()) { dos.writeUTF(st.columnString(0)); dos.writeInt(st.columnInt(1)); dos.writeDouble(st.columnDouble(2)); dos.writeUTF(st.columnString(3)); } else { break;
import com.almworks.sqlite4java.SQLiteConnection; import com.almworks.sqlite4java.SQLiteStatement; import org.junit.Test; import java.io.File; public class SqliteTest { @Test public void aTest() throws Exception { SQLiteConnection db = new SQLiteConnection(new File("/tmp/database")); db.open(true); SQLiteStatement st = db.prepare("SELECT name FROM dummy"); try { while(st.step()) { System.err.printf("name = %s\n", st.columnString(1)); } } finally { st.dispose(); } } }
SQLiteStatement st = conn.prepare("PRAGMA temp_store_directory"); st.step(); LOG.info("Changed temp_store_directory to: " + st.columnString(0));
static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { logger.entering("com.cloudant.sync.internal.sqlite.sqlite4java.SQLiteWrapperUtils","getDataRow",stmt); Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); // Log.v(LOG_TAG, "i: " + i + ", type: " + mapColumnType(type) + ", expected type: " + result.getType(i)); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }
return columnString(column); case SQLITE_BLOB: return columnBlob(column);
sh.setParamTree( ParamTreeParser.parseParamTree(stmt.columnString(SpectrumHeaderColIdx.paramTree)) ); sh.setScanList(ParamTreeParser.parseScanList(stmt.columnString(SpectrumHeaderColIdx.scanList))); sh.setPrecursor(ParamTreeParser.parsePrecursor(stmt.columnString(SpectrumHeaderColIdx.precursorList)));
sh.setParamTree( ParamTreeParser.parseParamTree(stmt.columnString(SpectrumHeaderColIdx.paramTree)) ); sh.setScanList(ParamTreeParser.parseScanList(stmt.columnString(SpectrumHeaderColIdx.scanList))); sh.setPrecursor(ParamTreeParser.parsePrecursor(stmt.columnString(SpectrumHeaderColIdx.precursorList)));