| java.lang.Object com.mysql.jdbc.StatementImpl com.mysql.jdbc.PreparedStatement com.mysql.jdbc.ServerPreparedStatement
ServerPreparedStatement | public class ServerPreparedStatement extends PreparedStatement (Code) | | JDBC Interface for MySQL-4.1 and newer server-side PreparedStatements.
author: Mark Matthews version: $Id: ServerPreparedStatement.java,v 1.1.2.2 2005/05/17 14:58:56 version: mmatthews Exp $ |
Inner Class :static class BatchedBindValues | |
Inner Class :public static class BindValue | |
Method Summary | |
public synchronized void | addBatch() JDBC 2.0 Add a set of parameters to the batch. | protected String | asSql(boolean quoteStreamsAndUnknowns) | protected void | checkClosed() | public void | clearParameters() | public void | close() | public synchronized int[] | executeBatch() | protected com.mysql.jdbc.ResultSetInternalMethods | executeInternal(int maxRowsToRetrieve, Buffer sendPacket, boolean createStreamingResultSet, boolean queryIsSelectOnly, Field[] metadataFromCache, boolean isBatch) | protected Buffer | fillSendPacket() | protected Buffer | fillSendPacket(byte[][] batchedParameterStrings, InputStream[] batchedParameterStreams, boolean[] batchedIsStream, int[] batchedStreamLengths) | protected BindValue | getBinding(int parameterIndex, boolean forLongData) Returns the structure representing the value that (can be)/(is)
bound at the given parameter index. | byte[] | getBytes(int parameterIndex) | protected static ServerPreparedStatement | getInstance(ConnectionImpl conn, String sql, String catalog, int resultSetType, int resultSetConcurrency) Creates a prepared statement instance -- We need to provide factory-style
methods so we can support both JDBC3 (and older) and JDBC4 runtimes,
otherwise the class verifier complains when it tries to load JDBC4-only
interface classes that are present in JDBC4 method signatures. | public java.sql.ResultSetMetaData | getMetaData() | public ParameterMetaData | getParameterMetaData() | protected long | getServerStatementId() | boolean | isNull(int paramIndex) | protected void | rePrepare() Used by Connection when auto-reconnecting to retrieve 'lost' prepared
statements. | protected void | realClose(boolean calledExplicitly, boolean closeOpenResults) Closes this connection and frees all resources. | public void | setArray(int i, Array x) | public void | setAsciiStream(int parameterIndex, InputStream x, int length) | public void | setBigDecimal(int parameterIndex, BigDecimal x) | public void | setBinaryStream(int parameterIndex, InputStream x, int length) | public void | setBlob(int parameterIndex, Blob x) | public void | setBoolean(int parameterIndex, boolean x) | public void | setByte(int parameterIndex, byte x) | public void | setBytes(int parameterIndex, byte[] x) | public void | setCharacterStream(int parameterIndex, Reader reader, int length) | public void | setClob(int parameterIndex, Clob x) | protected void | setClosed(boolean flag) | public void | setDate(int parameterIndex, Date x) Set a parameter to a java.sql.Date value. | public void | setDate(int parameterIndex, Date x, Calendar cal) Set a parameter to a java.sql.Date value. | public void | setDouble(int parameterIndex, double x) | public void | setFloat(int parameterIndex, float x) | public void | setInt(int parameterIndex, int x) | public void | setLong(int parameterIndex, long x) | public void | setNull(int parameterIndex, int sqlType) | public void | setNull(int parameterIndex, int sqlType, String typeName) | public void | setRef(int i, Ref x) | public void | setShort(int parameterIndex, short x) | public void | setString(int parameterIndex, String x) | public void | setTime(int parameterIndex, java.sql.Time x) Set a parameter to a java.sql.Time value. | public void | setTime(int parameterIndex, java.sql.Time x, Calendar cal) Set a parameter to a java.sql.Time value. | public void | setTimeInternal(int parameterIndex, java.sql.Time x, Calendar targetCalendar, TimeZone tz, boolean rollForward) Set a parameter to a java.sql.Time value. | public void | setTimestamp(int parameterIndex, java.sql.Timestamp x) Set a parameter to a java.sql.Timestamp value. | public void | setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) Set a parameter to a java.sql.Timestamp value. | protected void | setTimestampInternal(int parameterIndex, java.sql.Timestamp x, Calendar targetCalendar, TimeZone tz, boolean rollForward) | protected void | setType(BindValue oldValue, int bufferType) | public void | setURL(int parameterIndex, URL x) | public void | setUnicodeStream(int parameterIndex, InputStream x, int length) | public String | toString() |
BLOB_STREAM_READ_BUF_SIZE | final protected static int BLOB_STREAM_READ_BUF_SIZE(Code) | | |
isCached | protected boolean isCached(Code) | | |
ServerPreparedStatement | protected ServerPreparedStatement(ConnectionImpl conn, String sql, String catalog, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | Creates a new ServerPreparedStatement object.
Parameters: conn - the connection creating us. Parameters: sql - the SQL containing the statement to prepare. Parameters: catalog - the catalog in use when we were created. throws: SQLException - If an error occurs |
getBinding | protected BindValue getBinding(int parameterIndex, boolean forLongData) throws SQLException(Code) | | Returns the structure representing the value that (can be)/(is)
bound at the given parameter index.
Parameters: parameterIndex - 1-based Parameters: forLongData - is this for a stream? throws: SQLException - |
getInstance | protected static ServerPreparedStatement getInstance(ConnectionImpl conn, String sql, String catalog, int resultSetType, int resultSetConcurrency) throws SQLException(Code) | | Creates a prepared statement instance -- We need to provide factory-style
methods so we can support both JDBC3 (and older) and JDBC4 runtimes,
otherwise the class verifier complains when it tries to load JDBC4-only
interface classes that are present in JDBC4 method signatures.
|
getServerStatementId | protected long getServerStatementId()(Code) | | |
rePrepare | protected void rePrepare() throws SQLException(Code) | | Used by Connection when auto-reconnecting to retrieve 'lost' prepared
statements.
throws: SQLException - if an error occurs. |
realClose | protected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws SQLException(Code) | | Closes this connection and frees all resources.
Parameters: calledExplicitly - was this called from close()? throws: SQLException - if an error occurs |
setClosed | protected void setClosed(boolean flag)(Code) | | |
setDate | public void setDate(int parameterIndex, Date x) throws SQLException(Code) | | Set a parameter to a java.sql.Date value. The driver converts this to a
SQL DATE value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value exception: SQLException - if a database-access error occurs. |
setDate | public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException(Code) | | Set a parameter to a java.sql.Date value. The driver converts this to a
SQL DATE value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value Parameters: cal - the calendar to interpret the date with exception: SQLException - if a database-access error occurs. |
setTime | public void setTime(int parameterIndex, java.sql.Time x) throws SQLException(Code) | | Set a parameter to a java.sql.Time value.
Parameters: parameterIndex - the first parameter is 1...)); Parameters: x - the parameter value throws: SQLException - if a database access error occurs |
setTime | public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException(Code) | | Set a parameter to a java.sql.Time value. The driver converts this to a
SQL TIME value when it sends it to the database, using the given
timezone.
Parameters: parameterIndex - the first parameter is 1...)); Parameters: x - the parameter value Parameters: cal - the timezone to use throws: SQLException - if a database access error occurs |
setTimeInternal | public void setTimeInternal(int parameterIndex, java.sql.Time x, Calendar targetCalendar, TimeZone tz, boolean rollForward) throws SQLException(Code) | | Set a parameter to a java.sql.Time value. The driver converts this to a
SQL TIME value when it sends it to the database, using the given
timezone.
Parameters: parameterIndex - the first parameter is 1...)); Parameters: x - the parameter value Parameters: tz - the timezone to use throws: SQLException - if a database access error occurs |
setTimestamp | public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws SQLException(Code) | | Set a parameter to a java.sql.Timestamp value. The driver converts this
to a SQL TIMESTAMP value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value throws: SQLException - if a database-access error occurs. |
setTimestamp | public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException(Code) | | Set a parameter to a java.sql.Timestamp value. The driver converts this
to a SQL TIMESTAMP value when it sends it to the database.
Parameters: parameterIndex - the first parameter is 1, the second is 2, ... Parameters: x - the parameter value Parameters: cal - the timezone to use throws: SQLException - if a database-access error occurs. |
setType | protected void setType(BindValue oldValue, int bufferType)(Code) | | |
Methods inherited from com.mysql.jdbc.PreparedStatement | public void addBatch() throws SQLException(Code)(Java Doc) public synchronized void addBatch(String sql) throws SQLException(Code)(Java Doc) protected String asSql() throws SQLException(Code)(Java Doc) protected String asSql(boolean quoteStreamsAndUnknowns) throws SQLException(Code)(Java Doc) public synchronized boolean canRewriteAsMultivalueInsertStatement()(Code)(Java Doc) public synchronized void clearBatch() throws SQLException(Code)(Java Doc) public synchronized void clearParameters() throws SQLException(Code)(Java Doc) public synchronized void close() throws SQLException(Code)(Java Doc) protected int computeBatchSize(int numBatchedArgs)(Code)(Java Doc) protected long[] computeMaxParameterSetSizeAndBatchSize(int numBatchedArgs)(Code)(Java Doc) public boolean execute() throws SQLException(Code)(Java Doc) public int[] executeBatch() throws SQLException(Code)(Java Doc) protected int[] executeBatchSerially(int batchTimeout) throws SQLException(Code)(Java Doc) protected int[] executeBatchedInserts(int batchTimeout) throws SQLException(Code)(Java Doc) protected ResultSetInternalMethods executeInternal(int maxRowsToRetrieve, Buffer sendPacket, boolean createStreamingResultSet, boolean queryIsSelectOnly, Field[] metadataFromCache, boolean isBatch) throws SQLException(Code)(Java Doc) protected int[] executePreparedBatchAsMultiStatement(int batchTimeout) throws SQLException(Code)(Java Doc) public java.sql.ResultSet executeQuery() throws SQLException(Code)(Java Doc) public int executeUpdate() throws SQLException(Code)(Java Doc) protected int executeUpdate(boolean clearBatchedGeneratedKeysAndWarnings, boolean isBatch) throws SQLException(Code)(Java Doc) protected int executeUpdate(byte[][] batchedParameterStrings, InputStream[] batchedParameterStreams, boolean[] batchedIsStream, int[] batchedStreamLengths, boolean[] batchedIsNull, boolean isReallyBatch) throws SQLException(Code)(Java Doc) protected Buffer fillSendPacket() throws SQLException(Code)(Java Doc) protected Buffer fillSendPacket(byte[][] batchedParameterStrings, InputStream[] batchedParameterStreams, boolean[] batchedIsStream, int[] batchedStreamLengths) throws SQLException(Code)(Java Doc) public byte[] getBytesRepresentation(int parameterIndex) throws SQLException(Code)(Java Doc) protected static PreparedStatement getInstance(ConnectionImpl conn, String catalog) throws SQLException(Code)(Java Doc) protected static PreparedStatement getInstance(ConnectionImpl conn, String sql, String catalog) throws SQLException(Code)(Java Doc) protected static PreparedStatement getInstance(ConnectionImpl conn, String sql, String catalog, ParseInfo cachedParseInfo) throws SQLException(Code)(Java Doc) public java.sql.ResultSetMetaData getMetaData() throws SQLException(Code)(Java Doc) public ParameterBindings getParameterBindings() throws SQLException(Code)(Java Doc) protected int getParameterIndexOffset()(Code)(Java Doc) public ParameterMetaData getParameterMetaData() throws SQLException(Code)(Java Doc) ParseInfo getParseInfo()(Code)(Java Doc) public synchronized boolean isClosed() throws SQLException(Code)(Java Doc) boolean isNull(int paramIndex)(Code)(Java Doc) protected boolean isSelectQuery()(Code)(Java Doc) protected static int readFully(Reader reader, char[] buf, int length) throws IOException(Code)(Java Doc) protected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws SQLException(Code)(Java Doc) public void setArray(int i, Array x) throws SQLException(Code)(Java Doc) public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException(Code)(Java Doc) public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException(Code)(Java Doc) public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException(Code)(Java Doc) public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException(Code)(Java Doc) public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException(Code)(Java Doc) public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException(Code)(Java Doc) public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException(Code)(Java Doc) public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException(Code)(Java Doc) public void setBlob(int i, java.sql.Blob x) throws SQLException(Code)(Java Doc) public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException(Code)(Java Doc) public void setBoolean(int parameterIndex, boolean x) throws SQLException(Code)(Java Doc) public void setByte(int parameterIndex, byte x) throws SQLException(Code)(Java Doc) public void setBytes(int parameterIndex, byte[] x) throws SQLException(Code)(Java Doc) protected void setBytes(int parameterIndex, byte[] x, boolean checkForIntroducer, boolean escapeForMBChars) throws SQLException(Code)(Java Doc) protected void setBytesNoEscape(int parameterIndex, byte[] parameterAsBytes) throws SQLException(Code)(Java Doc) protected void setBytesNoEscapeNoQuotes(int parameterIndex, byte[] parameterAsBytes) throws SQLException(Code)(Java Doc) public void setCharacterStream(int parameterIndex, java.io.Reader reader, int length) throws SQLException(Code)(Java Doc) public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException(Code)(Java Doc) public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException(Code)(Java Doc) public void setClob(int i, Clob x) throws SQLException(Code)(Java Doc) public void setClob(int parameterIndex, Reader reader) throws SQLException(Code)(Java Doc) public void setClob(int parameterIndex, Reader reader, long length) throws SQLException(Code)(Java Doc) public void setDate(int parameterIndex, java.sql.Date x) throws java.sql.SQLException(Code)(Java Doc) public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException(Code)(Java Doc) public void setDouble(int parameterIndex, double x) throws SQLException(Code)(Java Doc) public void setFloat(int parameterIndex, float x) throws SQLException(Code)(Java Doc) public void setInt(int parameterIndex, int x) throws SQLException(Code)(Java Doc) final protected void setInternal(int paramIndex, byte[] val) throws SQLException(Code)(Java Doc) final protected void setInternal(int paramIndex, String val) throws SQLException(Code)(Java Doc) public void setLong(int parameterIndex, long x) throws SQLException(Code)(Java Doc) public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException(Code)(Java Doc) public void setNCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException(Code)(Java Doc) public void setNClob(int parameterIndex, Reader reader) throws SQLException(Code)(Java Doc) public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException(Code)(Java Doc) public void setNString(int parameterIndex, String x) throws SQLException(Code)(Java Doc) public void setNull(int parameterIndex, int sqlType) throws SQLException(Code)(Java Doc) public void setNull(int parameterIndex, int sqlType, String arg) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object parameterObj) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object parameterObj, int targetSqlType) throws SQLException(Code)(Java Doc) public void setObject(int parameterIndex, Object parameterObj, int targetSqlType, int scale) throws SQLException(Code)(Java Doc) protected int setOneBatchedParameterSet(java.sql.PreparedStatement batchedStatement, int batchedParamIndex, Object paramSet) throws SQLException(Code)(Java Doc) public void setRef(int i, Ref x) throws SQLException(Code)(Java Doc) void setResultSetConcurrency(int concurrencyFlag)(Code)(Java Doc) void setResultSetType(int typeFlag)(Code)(Java Doc) protected void setRetrieveGeneratedKeys(boolean retrieveGeneratedKeys)(Code)(Java Doc) public void setShort(int parameterIndex, short x) throws SQLException(Code)(Java Doc) public void setString(int parameterIndex, String x) throws SQLException(Code)(Java Doc) public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException(Code)(Java Doc) public void setTime(int parameterIndex, Time x) throws java.sql.SQLException(Code)(Java Doc) public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException(Code)(Java Doc) public void setTimestamp(int parameterIndex, Timestamp x) throws java.sql.SQLException(Code)(Java Doc) public void setURL(int parameterIndex, URL arg) throws SQLException(Code)(Java Doc) public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
Methods inherited from com.mysql.jdbc.StatementImpl | public synchronized void addBatch(String sql) throws SQLException(Code)(Java Doc) public void cancel() throws SQLException(Code)(Java Doc) protected void checkClosed() throws SQLException(Code)(Java Doc) protected void checkForDml(String sql, char firstStatementChar) throws SQLException(Code)(Java Doc) protected void checkNullOrEmptyQuery(String sql) throws SQLException(Code)(Java Doc) public synchronized void clearBatch() throws SQLException(Code)(Java Doc) public void clearWarnings() throws SQLException(Code)(Java Doc) public void close() throws SQLException(Code)(Java Doc) protected void closeAllOpenResults()(Code)(Java Doc) protected boolean createStreamingResultSet()(Code)(Java Doc) public void disableStreamingResults() throws SQLException(Code)(Java Doc) protected void doPingInstead() throws SQLException(Code)(Java Doc) public void enableStreamingResults() throws SQLException(Code)(Java Doc) public boolean execute(String sql) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int returnGeneratedKeys) throws SQLException(Code)(Java Doc) public boolean execute(String sql, int[] generatedKeyIndices) throws SQLException(Code)(Java Doc) public boolean execute(String sql, String[] generatedKeyNames) throws SQLException(Code)(Java Doc) public synchronized int[] executeBatch() throws SQLException(Code)(Java Doc) public java.sql.ResultSet executeQuery(String sql) throws SQLException(Code)(Java Doc) protected void executeSimpleNonQuery(ConnectionImpl c, String nonQuery) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql) throws SQLException(Code)(Java Doc) protected int executeUpdate(String sql, boolean isBatch) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int returnGeneratedKeys) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, int[] generatedKeyIndices) throws SQLException(Code)(Java Doc) public int executeUpdate(String sql, String[] generatedKeyNames) throws SQLException(Code)(Java Doc) protected int findStartOfStatement(String sql)(Code)(Java Doc) protected ResultSetInternalMethods generatePingResultSet() throws SQLException(Code)(Java Doc) protected void getBatchedGeneratedKeys(java.sql.Statement batchedStatement) throws SQLException(Code)(Java Doc) protected void getBatchedGeneratedKeys() throws SQLException(Code)(Java Doc) protected Calendar getCalendarInstanceForSessionOrNew()(Code)(Java Doc) public java.sql.Connection getConnection() throws SQLException(Code)(Java Doc) public int getFetchDirection() throws SQLException(Code)(Java Doc) public int getFetchSize() throws SQLException(Code)(Java Doc) public synchronized java.sql.ResultSet getGeneratedKeys() throws SQLException(Code)(Java Doc) protected java.sql.ResultSet getGeneratedKeysInternal() throws SQLException(Code)(Java Doc) protected int getId()(Code)(Java Doc) public long getLastInsertID()(Code)(Java Doc) public synchronized InputStream getLocalInfileInputStream()(Code)(Java Doc) public long getLongUpdateCount()(Code)(Java Doc) public int getMaxFieldSize() throws SQLException(Code)(Java Doc) public int getMaxRows() throws SQLException(Code)(Java Doc) public boolean getMoreResults() throws SQLException(Code)(Java Doc) public boolean getMoreResults(int current) throws SQLException(Code)(Java Doc) public int getQueryTimeout() throws SQLException(Code)(Java Doc) public java.sql.ResultSet getResultSet() throws SQLException(Code)(Java Doc) public int getResultSetConcurrency() throws SQLException(Code)(Java Doc) public int getResultSetHoldability() throws SQLException(Code)(Java Doc) protected ResultSetInternalMethods getResultSetInternal()(Code)(Java Doc) public int getResultSetType() throws SQLException(Code)(Java Doc) public int getUpdateCount() throws SQLException(Code)(Java Doc) public java.sql.SQLWarning getWarnings() throws SQLException(Code)(Java Doc) protected SQLException handleExceptionForBatch(int endOfBatchIndex, int numValuesPerBatch, int[] updateCounts, SQLException ex) throws BatchUpdateException(Code)(Java Doc) public synchronized boolean isClosed() throws SQLException(Code)(Java Doc) public boolean isPoolable() throws SQLException(Code)(Java Doc) public boolean isWrapperFor(Class iface) throws SQLException(Code)(Java Doc) protected int processMultiCountsAndKeys(StatementImpl batchedStatement, int updateCountCounter, int[] updateCounts) throws SQLException(Code)(Java Doc) protected void realClose(boolean calledExplicitly, boolean closeOpenResults) throws SQLException(Code)(Java Doc) protected synchronized void resetCancelledState()(Code)(Java Doc) public void setCursorName(String name) throws SQLException(Code)(Java Doc) public void setEscapeProcessing(boolean enable) throws SQLException(Code)(Java Doc) public void setFetchDirection(int direction) throws SQLException(Code)(Java Doc) public void setFetchSize(int rows) throws SQLException(Code)(Java Doc) protected void setHoldResultsOpenOverClose(boolean holdResultsOpenOverClose)(Code)(Java Doc) public synchronized void setLocalInfileInputStream(InputStream stream)(Code)(Java Doc) public void setMaxFieldSize(int max) throws SQLException(Code)(Java Doc) public void setMaxRows(int max) throws SQLException(Code)(Java Doc) public synchronized void setPingTarget(PingTarget pingTarget)(Code)(Java Doc) public void setPoolable(boolean poolable) throws SQLException(Code)(Java Doc) public void setQueryTimeout(int seconds) throws SQLException(Code)(Java Doc) void setResultSetConcurrency(int concurrencyFlag)(Code)(Java Doc) void setResultSetType(int typeFlag)(Code)(Java Doc) public Object unwrap(Class iface) throws java.sql.SQLException(Code)(Java Doc)
|
|
|