public PreparedStatement prepareStatement(String sql) throws SQLException { JDBCPreparedStatement s = new JDBCPreparedStatement(this, sql); return s; }
public void close() throws SQLException { clearBatch(); super.close(); }
blobs = new boolean[nparm]; try { clearParameters(); } catch (SQLException e) {
public int executeUpdate() throws SQLException { executeQuery(fixup2(sql), args, true); return updcnt; }
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { try { byte[] data = new byte[length]; x.read(data, 0, length); setBytes(parameterIndex, data); } catch (java.io.IOException e) { throw new SQLException("I/O failed"); } }
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { setNull(parameterIndex, sqlType); }
public JDBCPreparedStatement(JDBCConnection conn, String sql) { super(conn); this.args = null; this.blobs = null; this.batch = null; this.sql = fixup(sql); }
public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException { setDate(parameterIndex, x); }
public int[] executeBatch() throws SQLException { if (batch == null) { return new int[0]; } int[] ret = new int[batch.size() / args.length]; for (int i = 0; i < ret.length; i++) { ret[i] = EXECUTE_FAILED; } int errs = 0; int index = 0; for (int i = 0; i < ret.length; i++) { for (int k = 0; k < args.length; k++) { BatchArg b = (BatchArg) batch.get(index++); args[k] = b.arg; blobs[k] = b.blob; } try { ret[i] = executeUpdate(); } catch (SQLException e) { ++errs; } } if (errs > 0) { throw new BatchUpdateException("batch failed", ret); } return ret; }
public ResultSet executeQuery() throws SQLException { return executeQuery(fixup2(sql), args, false); }
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { try { byte[] data = new byte[length]; x.read(data, 0, length); setBytes(parameterIndex, data); } catch (java.io.IOException e) { throw new SQLException("I/O failed"); } }
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { setNull(parameterIndex, sqlType); }
public JDBCPreparedStatement(JDBCConnection conn, String sql) { super(conn); this.args = null; this.blobs = null; this.batch = null; this.sql = fixup(sql); }
public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException { setDate(parameterIndex, x); }
public int[] executeBatch() throws SQLException { if (batch == null) { return new int[0]; } int[] ret = new int[batch.size() / args.length]; for (int i = 0; i < ret.length; i++) { ret[i] = EXECUTE_FAILED; } int errs = 0; int index = 0; for (int i = 0; i < ret.length; i++) { for (int k = 0; k < args.length; k++) { BatchArg b = (BatchArg) batch.get(index++); args[k] = b.arg; blobs[k] = b.blob; } try { ret[i] = executeUpdate(); } catch (SQLException e) { ++errs; } } if (errs > 0) { throw new BatchUpdateException("batch failed", ret); } return ret; }
public boolean execute() throws SQLException { return executeQuery(fixup2(sql), args, false) != null; }
public PreparedStatement prepareStatement(String sql, 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"); } JDBCPreparedStatement s = new JDBCPreparedStatement(this, sql); return s; }
public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException { try { byte[] data = new byte[length]; x.read(data, 0, length); setBytes(parameterIndex, data); } catch (java.io.IOException e) { throw new SQLException("I/O failed"); } }
public void close() throws SQLException { clearBatch(); super.close(); }
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException { setNull(parameterIndex, sqlType); }