void set_table_name(String str) { if (str == null) { tableName = ""; return; } if (db.is3()) { tableName = Shell.sql_quote_dbl(str); } else { tableName = Shell.sql_quote(str); } }
protected Object clone() { Shell s = new Shell(this.pw, this.err); s.db = db; s.echo = echo; s.mode = mode; s.count = 0; s.showHeader = showHeader; s.tableName = tableName; s.sep = sep; s.colwidth = colwidth; return s; }
/** * Establish a busy callback method which gets called when * an SQLite table is locked. * * @param bh the object implementing the busy callback method */ public void busy_handler(SQLite.BusyHandler bh) { synchronized(this) { _busy_handler(bh); } }
/** * Compile and return SQLite VM for SQL statement. Only available * in SQLite 2.8.0 and above, otherwise a no-op. * * @param sql SQL statement to be compiled * @return a Vm object */ public Vm compile(String sql) throws SQLite.Exception { synchronized(this) { Vm vm = new Vm(); vm_compile(sql, vm); return vm; } }
/** * Prepare and return SQLite3 statement for SQL. Only available * in SQLite 3.0 and above, otherwise a no-op. * * @param sql SQL statement to be prepared * @return a Stmt object */ public Stmt prepare(String sql) throws SQLite.Exception { synchronized(this) { Stmt stmt = new Stmt(); stmt_prepare(sql, stmt); return stmt; } }
/** * Set the timeout for waiting for an SQLite table to become * unlocked. * * @param ms number of millisecond to wait */ public void busy_timeout(int ms) { synchronized(this) { _busy_timeout(ms); } }
/** * Convenience method to retrieve an entire result * set into memory. * * @param sql the SQL statement to be executed * @param args arguments for the SQL statement, '%q' substitution * @return result set */ public TableResult get_table(String sql, String args[]) throws SQLite.Exception { return get_table(sql, 0, args); }
/** * Create regular function. * * @param name the name of the new function * @param nargs number of arguments to function * @param f interface of function */ public void create_function(String name, int nargs, Function f) { synchronized(this) { _create_function(name, nargs, f); } }
/** * Return last error message of SQLite3 engine. * * @return error string or null */ public String error_message() { synchronized(this) { return _errmsg(); } }
/** * Close this blob InputStream. */ public void close() throws IOException { blob.close(); blob = null; pos = 0; }
/** * Write blob data. * @param v byte to be written at current position. */ public void write(int v) throws IOException { byte b[] = new byte[1]; b[0] = (byte) v; pos += blob.write(b, 0, pos, 1); }
/** * Return InputStream for this blob * @return InputStream */ public InputStream getInputStream() { return (InputStream) new BlobR(this); }
/** * Finish a backup. */ protected void finish() throws SQLite.Exception { synchronized(this) { _finalize(); } }
/** * Return the row identifier of the last inserted * row. */ public long last_insert_rowid() { synchronized(this) { return _last_insert_rowid(); } }
/** * Return the number of changed rows for the last statement. */ public long changes() { synchronized(this) { return _changes(); } }
/** * See if an SQL statement is complete. * Returns true if the input string comprises * one or more complete SQL statements. * * @param sql the SQL statement to be checked */ public synchronized static boolean complete(String sql) { return _complete(sql); }
/** * Create aggregate function. * * @param name the name of the new function * @param nargs number of arguments to function * @param f interface of function */ public void create_aggregate(String name, int nargs, Function f) { synchronized(this) { _create_aggregate(name, nargs, f); } }
/** * Set function return type. Only available in SQLite 2.6.0 and * above, otherwise a no-op. * * @param name the name of the function whose return type is to be set * @param type return type code, e.g. SQLite.Constants.SQLITE_NUMERIC */ public void function_type(String name, int type) { synchronized(this) { _function_type(name, type); } }
/** * Set trace function. Only available in SQLite 2.7.6 and above, * otherwise a no-op. * * @param tr the trace function */ public void trace(Trace tr) { synchronized(this) { _trace(tr); } }
/** * Set profile function. Only available in SQLite 3.6 and above, * otherwise a no-op. * * @param pr the trace function */ public void profile(Profile pr) { synchronized(this) { _profile(pr); } }