/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
public void deleteRow() throws SQLException { isUpdatable(); if (oninsrow) { throw new SQLException("cursor on insert row"); } if (updatable < UPD_INSUPDDEL) { throw new SQLException("no primary key on table defined"); } fillRowbuf(); StringBuffer sb = new StringBuffer(); sb.append("DELETE FROM "); sb.append(SQLite.Shell.sql_quote_dbl(uptable)); sb.append(" WHERE "); String args[] = new String[pkcols.length]; for (int i = 0; i < pkcols.length; i++) { sb.append(SQLite.Shell.sql_quote_dbl(pkcols[i])); sb.append(" = " + (nullrepl ? "'%q'" : "%Q")); if (i < pkcols.length - 1) { sb.append(" AND "); } args[i] = rowbuf[pkcoli[i]]; } try { this.s.conn.db.exec(sb.toString(), null, args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage()); } rowbuf = null; }
public void setAutoCommit(boolean ac) throws SQLException { if (ac && intrans && db != null) { try { db.exec("ROLLBACK", null); } catch (SQLite.Exception e) { throw new SQLException(e.toString()); } finally { intrans = false; } } autocommit = ac; }
public void commit() throws SQLException { if (db == null) { throw new SQLException("stale connection"); } if (!intrans) { return; } try { db.exec("COMMIT", null); intrans = false; } catch (SQLite.Exception e) { throw new SQLException(e.toString()); } }
this.s.conn.db.exec(sb.toString(), null, args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage());
/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
public void rollback() throws SQLException { if (db == null) { throw new SQLException("stale connection"); } if (!intrans) { return; } try { db.exec("ROLLBACK", null); intrans = false; } catch (SQLite.Exception e) { throw new SQLException(e.toString()); } }
trnew = this.s.conn.db.get_table(sb.toString(), args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage());
/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
public void close() throws SQLException { try { rollback(); } catch (SQLException e) { /* ignored */ } intrans = false; if (db != null) { try { db.close(); db = null; } catch (SQLite.Exception e) { throw new SQLException(e.toString()); } } }
this.s.conn.db.exec(sb.toString(), null, rowbuf); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage());
/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
public void setReadOnly(boolean ro) throws SQLException { if (intrans) { throw new SQLException("incomplete transaction"); } if (ro != readonly) { DatabaseX dbx = null; try { dbx = open(ro); db.close(); db = dbx; dbx = null; readonly = ro; } catch (SQLException e) { throw e; } catch (SQLite.Exception ee) { if (dbx != null) { try { dbx.close(); } catch (SQLite.Exception eee) { } } throw new SQLException(ee.toString()); } } }
public void deleteRow() throws SQLException { isUpdatable(); if (oninsrow) { throw new SQLException("cursor on insert row"); } if (updatable < UPD_INSUPDDEL) { throw new SQLException("no primary key on table defined"); } fillRowbuf(); StringBuffer sb = new StringBuffer(); sb.append("DELETE FROM "); sb.append(SQLite.Shell.sql_quote_dbl(uptable)); sb.append(" WHERE "); String args[] = new String[pkcols.length]; for (int i = 0; i < pkcols.length; i++) { sb.append(SQLite.Shell.sql_quote_dbl(pkcols[i])); sb.append(" = " + (nullrepl ? "'%q'" : "%Q")); if (i < pkcols.length - 1) { sb.append(" AND "); } args[i] = rowbuf[pkcoli[i]]; } try { this.s.conn.db.exec(sb.toString(), null, args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage()); } rowbuf = null; }
/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
public void deleteRow() throws SQLException { isUpdatable(); if (oninsrow) { throw new SQLException("cursor on insert row"); } if (updatable < UPD_INSUPDDEL) { throw new SQLException("no primary key on table defined"); } fillRowbuf(); StringBuffer sb = new StringBuffer(); sb.append("DELETE FROM "); sb.append(SQLite.Shell.sql_quote_dbl(uptable)); sb.append(" WHERE "); String args[] = new String[pkcols.length]; for (int i = 0; i < pkcols.length; i++) { sb.append(SQLite.Shell.sql_quote_dbl(pkcols[i])); sb.append(" = " + (nullrepl ? "'%q'" : "%Q")); if (i < pkcols.length - 1) { sb.append(" AND "); } args[i] = rowbuf[pkcoli[i]]; } try { this.s.conn.db.exec(sb.toString(), null, args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage()); } rowbuf = null; }
/** * Make long value from julian date for java.lang.Date * * @param s string (double value) (julian date in SQLite3 format) * @return long */ public static long long_from_julian(String s) throws SQLite.Exception { try { double d = Double.parseDouble(s); // android-changed: performance return long_from_julian(d); } catch (java.lang.Exception ee) { throw new SQLite.Exception("not a julian date"); } }
throw new SQLException(e.toString());
public void deleteRow() throws SQLException { isUpdatable(); if (oninsrow) { throw new SQLException("cursor on insert row"); } if (updatable < UPD_INSUPDDEL) { throw new SQLException("no primary key on table defined"); } fillRowbuf(); StringBuffer sb = new StringBuffer(); sb.append("DELETE FROM "); sb.append(SQLite.Shell.sql_quote_dbl(uptable)); sb.append(" WHERE "); String args[] = new String[pkcols.length]; for (int i = 0; i < pkcols.length; i++) { sb.append(SQLite.Shell.sql_quote_dbl(pkcols[i])); sb.append(" = " + (nullrepl ? "'%q'" : "%Q")); if (i < pkcols.length - 1) { sb.append(" AND "); } args[i] = rowbuf[pkcoli[i]]; } try { this.s.conn.db.exec(sb.toString(), null, args); } catch (SQLite.Exception e) { throw new SQLException(e.getMessage()); } rowbuf = null; }