public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String types[]) throws SQLException { JDBCStatement s = new JDBCStatement(conn); StringBuffer sb = new StringBuffer(); sb.append("SELECT '' AS 'TABLE_CAT', " + rs = s.executeQuery(sb.toString()); s.close(); } catch (SQLException e) { throw e; } finally { s.close();
public void close() throws SQLException { clearBatch(); conn = null; }
public boolean execute(String sql, int autokeys) throws SQLException { if (autokeys != Statement.NO_GENERATED_KEYS) { throw new SQLFeatureNotSupportedException("autogenerated keys not supported"); } return execute(sql); }
public int executeUpdate(String sql) throws SQLException { executeQuery(sql, null, true); return updcnt; }
public Statement createStatement() { JDBCStatement s = new JDBCStatement(this); return s; }
public int executeUpdate(String sql, int autokeys) throws SQLException { if (autokeys != Statement.NO_GENERATED_KEYS) { throw new SQLFeatureNotSupportedException("generated keys not supported"); } return executeUpdate(sql); }
public void close() throws SQLException { clearBatch(); super.close(); }
public void setQueryTimeout(int seconds) throws SQLException { // BEGIN android-changed: more closely follow specification: // "[throws SQLException if] this method is called on a closed Statement or the condition // seconds >= 0 is not satisfied" // (http://java.sun.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int)) if (isClosed()) { throw new SQLException("can't set a query timeout on a closed statement"); } else if (seconds < 0) { throw new SQLException("can't set a query timeout of less than 0 seconds"); } else if (seconds == 0) { // An argument of 0 seconds should set an unlimited timeout. However, since this was not // done previously, I assume it isn't implemented and use the same implementation. conn.timeout = 5000; } else { conn.timeout = seconds * 1000; } // END android-changed }
public ResultSet executeQuery(String sql) throws SQLException { return executeQuery(sql, null, false); }
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { if (resultSetType != ResultSet.TYPE_FORWARD_ONLY && resultSetType != ResultSet.TYPE_SCROLL_INSENSITIVE && resultSetType != ResultSet.TYPE_SCROLL_SENSITIVE) { throw new SQLFeatureNotSupportedException("unsupported result set type"); } if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY && resultSetConcurrency != ResultSet.CONCUR_UPDATABLE) { throw new SQLFeatureNotSupportedException("unsupported result set concurrency"); } JDBCStatement s = new JDBCStatement(this); return s; }
public int executeUpdate(String sql, int autokeys) throws SQLException { if (autokeys != Statement.NO_GENERATED_KEYS) { throw new SQLFeatureNotSupportedException("generated keys not supported"); } return executeUpdate(sql); }
public void close() throws SQLException { clearBatch(); super.close(); }
public void setQueryTimeout(int seconds) throws SQLException { // BEGIN android-changed: more closely follow specification: // "[throws SQLException if] this method is called on a closed Statement or the condition // seconds >= 0 is not satisfied" // (http://java.sun.com/javase/6/docs/api/java/sql/Statement.html#setQueryTimeout(int)) if (isClosed()) { throw new SQLException("can't set a query timeout on a closed statement"); } else if (seconds < 0) { throw new SQLException("can't set a query timeout of less than 0 seconds"); } else if (seconds == 0) { // An argument of 0 seconds should set an unlimited timeout. However, since this was not // done previously, I assume it isn't implemented and use the same implementation. conn.timeout = 5000; } else { conn.timeout = seconds * 1000; } // END android-changed }
public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException { JDBCStatement s0 = new JDBCStatement(conn); JDBCResultSet rs0 = null; try { (s0.executeQuery("PRAGMA index_list(" + SQLite.Shell.sql_quote(table) + ")")); } catch (SQLException e) { throw e; } finally { s0.close(); continue; JDBCStatement s1 = new JDBCStatement(conn); JDBCResultSet rs1 = null; try { rs1 = (JDBCResultSet) (s1.executeQuery("PRAGMA index_info(" + SQLite.Shell.sql_quote(iname) + ")")); } catch (SQLException e) { } finally { s1.close();
public boolean execute(String sql) throws SQLException { return executeQuery(sql) != null; }
public int[] executeBatch() throws SQLException { if (batch == null) { return new int[0]; } int[] ret = new int[batch.size()]; for (int i = 0; i < ret.length; i++) { ret[i] = EXECUTE_FAILED; } int errs = 0; for (int i = 0; i < ret.length; i++) { try { execute((String) batch.get(i)); ret[i] = updcnt; } catch (SQLException e) { ++errs; } } if (errs > 0) { throw new BatchUpdateException("batch failed", ret); } return ret; }
public Statement createStatement() { JDBCStatement s = new JDBCStatement(this); return s; }
public int executeUpdate(String sql, int autokeys) throws SQLException { if (autokeys != Statement.NO_GENERATED_KEYS) { throw new SQLFeatureNotSupportedException("generated keys not supported"); } return executeUpdate(sql); }
public void close() throws SQLException { clearBatch(); conn = null; }
public void close() throws SQLException { clearBatch(); super.close(); }