|
|||||||||
| Home >> All >> com >> mysql >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.mysql.jdbc
Class PreparedStatement

java.lang.Objectcom.mysql.jdbc.Statement
com.mysql.jdbc.PreparedStatement
- All Implemented Interfaces:
- java.sql.PreparedStatement, java.sql.Statement
- public class PreparedStatement
- extends Statement
- implements java.sql.PreparedStatement
- extends Statement
A SQL Statement is pre-compiled and stored in a PreparedStatement object. This object can then be used to efficiently execute this statement multiple times.
Note: The setXXX methods for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type Integer, then setInt should be used.
If arbitrary parameter type conversions are required, then the setObject method should be used with a target SQL type.
- Version:
- $Id: PreparedStatement.java,v 1.27.2.45 2004/08/27 21:50:12 mmatthew Exp $
| Nested Class Summary | |
(package private) class |
PreparedStatement.BatchParams
|
(package private) class |
PreparedStatement.ParseInfo
|
| Field Summary | |
private java.util.ArrayList |
batchedGeneratedKeys
|
private java.sql.DatabaseMetaData |
dbmd
|
private char |
firstCharOfStmt
|
private boolean |
hasLimitClause
|
private boolean |
isLoadDataQuery
|
private boolean[] |
isNull
|
private boolean[] |
isStream
|
private java.lang.String |
originalSql
|
private java.io.InputStream[] |
parameterStreams
|
private byte[][] |
parameterValues
|
private PreparedStatement.ParseInfo |
parseInfo
|
private java.sql.ResultSetMetaData |
pstmtResultMetaData
|
private boolean |
retrieveGeneratedKeys
|
private byte[][] |
staticSqlStrings
|
private byte[] |
streamConvertBuf
|
private int[] |
streamLengths
|
private java.text.SimpleDateFormat |
tsdf
|
private boolean |
useTrueBoolean
|
| Fields inherited from class com.mysql.jdbc.Statement |
batchedArgs, charConverter, charEncoding, connection, currentCatalog, doEscapeProcessing, isClosed, lastInsertId, maxFieldSize, maxRows, maxRowsChanged, nextResults, openResults, pedantic, pendingWarnings, results, resultSetConcurrency, resultSetType, timeout, updateCount, warningChain |
| Fields inherited from interface java.sql.Statement |
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO |
| Constructor Summary | |
PreparedStatement(Connection conn,
java.lang.String sql,
java.lang.String catalog)
Constructor for the PreparedStatement class. |
|
PreparedStatement(Connection conn,
java.lang.String sql,
java.lang.String catalog,
PreparedStatement.ParseInfo cachedParseInfo)
Creates a new PreparedStatement object. |
|
| Method Summary | |
void |
addBatch()
JDBC 2.0 Add a set of parameters to the batch. |
void |
clearParameters()
In general, parameter values remain in force for repeated used of a Statement. |
void |
close()
Closes this prepared statement and releases all resources. |
private void |
escapeblockFast(byte[] buf,
Buffer packet,
int size)
|
private void |
escapeblockFast(byte[] buf,
java.io.ByteArrayOutputStream bytesOut,
int size)
|
boolean |
execute()
Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by executeQuery and executeUpdate |
int[] |
executeBatch()
JDBC 2.0 Submit a batch of commands to the database for execution. |
java.sql.ResultSet |
executeQuery()
A Prepared SQL query is executed and its ResultSet is returned |
int |
executeUpdate()
Execute a SQL INSERT, UPDATE or DELETE statement. |
protected int |
executeUpdate(byte[][] batchedParameterStrings,
java.io.InputStream[] batchedParameterStreams,
boolean[] batchedIsStream,
int[] batchedStreamLengths,
boolean[] batchedIsNull)
Added to allow batch-updates |
private Buffer |
fillSendPacket()
Creates the packet that contains the query to be sent to the server. |
private Buffer |
fillSendPacket(byte[][] batchedParameterStrings,
java.io.InputStream[] batchedParameterStreams,
boolean[] batchedIsStream,
int[] batchedStreamLengths)
Creates the packet that contains the query to be sent to the server. |
private static java.lang.String |
fixDecimalExponent(java.lang.String dString)
|
(package private) byte[] |
getBytes(int parameterIndex)
|
private java.lang.String |
getDateTimePattern(java.lang.String dt,
boolean toTime)
|
java.sql.ResultSet |
getGeneratedKeys()
DOCUMENT ME! |
java.sql.ResultSetMetaData |
getMetaData()
The number, types and properties of a ResultSet's columns are provided by the getMetaData method. |
java.sql.ParameterMetaData |
getParameterMetaData()
Returns information about the parameters set on this PreparedStatement (see java.sql.ParameterMetaData for a
detailed description of the provided information). |
(package private) PreparedStatement.ParseInfo |
getParseInfo()
|
private char |
getSuccessor(char c,
int n)
|
private void |
initializeFromParseInfo()
|
(package private) boolean |
isNull(int paramIndex)
|
private int |
readblock(java.io.InputStream i,
byte[] b)
|
private int |
readblock(java.io.InputStream i,
byte[] b,
int length)
|
private static int |
readFully(java.io.Reader reader,
char[] buf,
int length)
Reads length bytes from reader into buf. |
void |
setArray(int i,
java.sql.Array x)
JDBC 2.0 Set an Array parameter. |
void |
setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
When a very large ASCII value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. |
void |
setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
Set a parameter to a java.math.BigDecimal value. |
void |
setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
When a very large binary value is input to a LONGVARBINARY parameter, it may be more practical to send it via a java.io.InputStream. |
void |
setBlob(int i,
java.sql.Blob x)
JDBC 2.0 Set a BLOB parameter. |
void |
setBoolean(int parameterIndex,
boolean x)
Set a parameter to a Java boolean value. |
void |
setByte(int parameterIndex,
byte x)
Set a parameter to a Java byte value. |
void |
setBytes(int parameterIndex,
byte[] x)
Set a parameter to a Java array of bytes. |
protected void |
setBytes(int parameterIndex,
byte[] x,
boolean checkForIntroducer)
|
protected void |
setBytesNoEscape(int parameterIndex,
byte[] parameterAsBytes)
Used by updatable result sets for refreshRow() because the parameter has already been escaped for updater or inserter prepared statements. |
void |
setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length)
JDBC 2.0 When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader. |
void |
setClob(int i,
java.sql.Clob x)
JDBC 2.0 Set a CLOB parameter. |
void |
setDate(int parameterIndex,
java.sql.Date x)
Set a parameter to a java.sql.Date value. |
void |
setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
Set a parameter to a java.sql.Date value. |
void |
setDouble(int parameterIndex,
double x)
Set a parameter to a Java double value. |
void |
setFloat(int parameterIndex,
float x)
Set a parameter to a Java float value. |
void |
setInt(int parameterIndex,
int x)
Set a parameter to a Java int value. |
private void |
setInternal(int paramIndex,
byte[] val)
|
private void |
setInternal(int paramIndex,
java.lang.String val)
|
void |
setLong(int parameterIndex,
long x)
Set a parameter to a Java long value. |
void |
setNull(int parameterIndex,
int sqlType)
Set a parameter to SQL NULL |
void |
setNull(int parameterIndex,
int sqlType,
java.lang.String arg)
Set a parameter to SQL NULL. |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj)
Sets the given parameter to the given object. |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj,
int targetSqlType)
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values. |
void |
setObject(int parameterIndex,
java.lang.Object parameterObj,
int targetSqlType,
int scale)
Set the value of a parameter using an object; use the java.lang equivalent objects for integral values. |
void |
setRef(int i,
java.sql.Ref x)
JDBC 2.0 Set a REF(<structured-type>) parameter. |
(package private) void |
setResultSetConcurrency(int concurrencyFlag)
Sets the concurrency for result sets generated by this statement |
(package private) void |
setResultSetType(int typeFlag)
Sets the result set type for result sets generated by this statement |
protected void |
setRetrieveGeneratedKeys(boolean retrieveGeneratedKeys)
Sets wheather or not this statement should retreive generated keys. |
private void |
setSerializableObject(int parameterIndex,
java.lang.Object parameterObj)
Sets the value for the placeholder as a serialized Java object (used by various forms of setObject() |
void |
setShort(int parameterIndex,
short x)
Set a parameter to a Java short value. |
void |
setString(int parameterIndex,
java.lang.String x)
Set a parameter to a Java String value. |
void |
setTime(int parameterIndex,
java.sql.Time x)
Set a parameter to a java.sql.Time value. |
void |
setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal)
Set a parameter to a java.sql.Time value. |
private void |
setTimeInternal(int parameterIndex,
java.sql.Time x,
java.util.TimeZone tz)
Set a parameter to a java.sql.Time value. |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x)
Set a parameter to a java.sql.Timestamp value. |
void |
setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
Set a parameter to a java.sql.Timestamp value. |
private void |
setTimestampInternal(int parameterIndex,
java.sql.Timestamp x,
java.util.TimeZone tz)
Set a parameter to a java.sql.Timestamp value. |
void |
setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
Deprecated. |
void |
setURL(int parameterIndex,
java.net.URL arg)
This method sets the specified parameter from the given Java java.net.URL value. |
private void |
streamToBytes(Buffer packet,
java.io.InputStream in,
boolean escape,
int streamLength,
boolean useLength)
|
private byte[] |
streamToBytes(java.io.InputStream in,
boolean escape,
int streamLength,
boolean useLength)
|
private byte[] |
streamToBytes(java.io.InputStream in,
int streamLength,
boolean useLength)
For the setXXXStream() methods. |
java.lang.String |
toString()
Returns this PreparedStatement represented as a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
batchedGeneratedKeys
private java.util.ArrayList batchedGeneratedKeys
dbmd
private java.sql.DatabaseMetaData dbmd
parseInfo
private PreparedStatement.ParseInfo parseInfo
pstmtResultMetaData
private java.sql.ResultSetMetaData pstmtResultMetaData
tsdf
private java.text.SimpleDateFormat tsdf
originalSql
private java.lang.String originalSql
isNull
private boolean[] isNull
isStream
private boolean[] isStream
parameterStreams
private java.io.InputStream[] parameterStreams
parameterValues
private byte[][] parameterValues
staticSqlStrings
private byte[][] staticSqlStrings
streamConvertBuf
private byte[] streamConvertBuf
streamLengths
private int[] streamLengths
hasLimitClause
private boolean hasLimitClause
isLoadDataQuery
private boolean isLoadDataQuery
retrieveGeneratedKeys
private boolean retrieveGeneratedKeys
useTrueBoolean
private boolean useTrueBoolean
firstCharOfStmt
private char firstCharOfStmt
| Constructor Detail |
PreparedStatement
public PreparedStatement(Connection conn, java.lang.String sql, java.lang.String catalog) throws java.sql.SQLException
- Constructor for the PreparedStatement class.
PreparedStatement
public PreparedStatement(Connection conn, java.lang.String sql, java.lang.String catalog, PreparedStatement.ParseInfo cachedParseInfo) throws java.sql.SQLException
- Creates a new PreparedStatement object.
| Method Detail |
setArray
public void setArray(int i,
java.sql.Array x)
throws java.sql.SQLException
- JDBC 2.0 Set an Array parameter.
- Specified by:
setArrayin interfacejava.sql.PreparedStatement
setAsciiStream
public void setAsciiStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- When a very large ASCII value is input to a LONGVARCHAR parameter, it
may be more practical to send it via a java.io.InputStream. JDBC will
read the data from the stream as needed, until it reaches end-of-file.
The JDBC driver will do any necessary conversion from ASCII to the
database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
- Specified by:
setAsciiStreamin interfacejava.sql.PreparedStatement
setBigDecimal
public void setBigDecimal(int parameterIndex,
java.math.BigDecimal x)
throws java.sql.SQLException
- Set a parameter to a java.math.BigDecimal value. The driver converts
this to a SQL NUMERIC value when it sends it to the database.
- Specified by:
setBigDecimalin interfacejava.sql.PreparedStatement
setBinaryStream
public void setBinaryStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- When a very large binary value is input to a LONGVARBINARY parameter, it
may be more practical to send it via a java.io.InputStream. JDBC will
read the data from the stream as needed, until it reaches end-of-file.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
- Specified by:
setBinaryStreamin interfacejava.sql.PreparedStatement
setBlob
public void setBlob(int i,
java.sql.Blob x)
throws java.sql.SQLException
- JDBC 2.0 Set a BLOB parameter.
- Specified by:
setBlobin interfacejava.sql.PreparedStatement
setBoolean
public void setBoolean(int parameterIndex,
boolean x)
throws java.sql.SQLException
- Set a parameter to a Java boolean value. The driver converts this to a
SQL BIT value when it sends it to the database.
- Specified by:
setBooleanin interfacejava.sql.PreparedStatement
setByte
public void setByte(int parameterIndex,
byte x)
throws java.sql.SQLException
- Set a parameter to a Java byte value. The driver converts this to a SQL
TINYINT value when it sends it to the database.
- Specified by:
setBytein interfacejava.sql.PreparedStatement
setBytes
public void setBytes(int parameterIndex,
byte[] x)
throws java.sql.SQLException
- Set a parameter to a Java array of bytes. The driver converts this to a
SQL VARBINARY or LONGVARBINARY (depending on the argument's size
relative to the driver's limits on VARBINARYs) when it sends it to the
database.
- Specified by:
setBytesin interfacejava.sql.PreparedStatement
setBytes
protected void setBytes(int parameterIndex,
byte[] x,
boolean checkForIntroducer)
throws java.sql.SQLException
setCharacterStream
public void setCharacterStream(int parameterIndex,
java.io.Reader reader,
int length)
throws java.sql.SQLException
- JDBC 2.0 When a very large UNICODE value is input to a LONGVARCHAR
parameter, it may be more practical to send it via a java.io.Reader.
JDBC will read the data from the stream as needed, until it reaches
end-of-file. The JDBC driver will do any necessary conversion from
UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
- Specified by:
setCharacterStreamin interfacejava.sql.PreparedStatement
setClob
public void setClob(int i,
java.sql.Clob x)
throws java.sql.SQLException
- JDBC 2.0 Set a CLOB parameter.
- Specified by:
setClobin interfacejava.sql.PreparedStatement
setDate
public void setDate(int parameterIndex,
java.sql.Date x)
throws java.sql.SQLException
- 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.
- Specified by:
setDatein interfacejava.sql.PreparedStatement
setDate
public void setDate(int parameterIndex,
java.sql.Date x,
java.util.Calendar cal)
throws java.sql.SQLException
- 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.
- Specified by:
setDatein interfacejava.sql.PreparedStatement
setDouble
public void setDouble(int parameterIndex,
double x)
throws java.sql.SQLException
- Set a parameter to a Java double value. The driver converts this to a
SQL DOUBLE value when it sends it to the database
- Specified by:
setDoublein interfacejava.sql.PreparedStatement
setFloat
public void setFloat(int parameterIndex,
float x)
throws java.sql.SQLException
- Set a parameter to a Java float value. The driver converts this to a
SQL FLOAT value when it sends it to the database.
- Specified by:
setFloatin interfacejava.sql.PreparedStatement
getGeneratedKeys
public java.sql.ResultSet getGeneratedKeys() throws java.sql.SQLException
- Description copied from class:
Statement - DOCUMENT ME!
- Specified by:
getGeneratedKeysin interfacejava.sql.Statement- Overrides:
getGeneratedKeysin classStatement
setInt
public void setInt(int parameterIndex,
int x)
throws java.sql.SQLException
- Set a parameter to a Java int value. The driver converts this to a SQL
INTEGER value when it sends it to the database.
- Specified by:
setIntin interfacejava.sql.PreparedStatement
setLong
public void setLong(int parameterIndex,
long x)
throws java.sql.SQLException
- Set a parameter to a Java long value. The driver converts this to a SQL
BIGINT value when it sends it to the database.
- Specified by:
setLongin interfacejava.sql.PreparedStatement
getMetaData
public java.sql.ResultSetMetaData getMetaData() throws java.sql.SQLException
- The number, types and properties of a ResultSet's columns are provided
by the getMetaData method.
- Specified by:
getMetaDatain interfacejava.sql.PreparedStatement
setNull
public void setNull(int parameterIndex,
int sqlType)
throws java.sql.SQLException
- Set a parameter to SQL NULL
Note: You must specify the parameters SQL type (although MySQL ignores it)
- Specified by:
setNullin interfacejava.sql.PreparedStatement
setNull
public void setNull(int parameterIndex,
int sqlType,
java.lang.String arg)
throws java.sql.SQLException
- Set a parameter to SQL NULL.
Note: You must specify the parameter's SQL type.
- Specified by:
setNullin interfacejava.sql.PreparedStatement
setObject
public void setObject(int parameterIndex,
java.lang.Object parameterObj,
int targetSqlType,
int scale)
throws java.sql.SQLException
- Set the value of a parameter using an object; use the java.lang
equivalent objects for integral values.
The given Java object will be converted to the targetSqlType before being sent to the database.
note that this method may be used to pass database-specific abstract data types. This is done by using a Driver-specific Java type and using a targetSqlType of java.sql.Types.OTHER
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
setObject
public void setObject(int parameterIndex,
java.lang.Object parameterObj,
int targetSqlType)
throws java.sql.SQLException
- Set the value of a parameter using an object; use the java.lang
equivalent objects for integral values.
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
setObject
public void setObject(int parameterIndex,
java.lang.Object parameterObj)
throws java.sql.SQLException
- Sets the given parameter to the given object.
- Specified by:
setObjectin interfacejava.sql.PreparedStatement
getParameterMetaData
public java.sql.ParameterMetaData getParameterMetaData() throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - Returns information about the parameters set on this
PreparedStatement(see java.sql.ParameterMetaData for a detailed description of the provided information).- Specified by:
getParameterMetaDatain interfacejava.sql.PreparedStatement
setRef
public void setRef(int i,
java.sql.Ref x)
throws java.sql.SQLException
- JDBC 2.0 Set a REF(<structured-type>) parameter.
- Specified by:
setRefin interfacejava.sql.PreparedStatement
setShort
public void setShort(int parameterIndex,
short x)
throws java.sql.SQLException
- Set a parameter to a Java short value. The driver converts this to a
SQL SMALLINT value when it sends it to the database.
- Specified by:
setShortin interfacejava.sql.PreparedStatement
setString
public void setString(int parameterIndex,
java.lang.String x)
throws java.sql.SQLException
- Set a parameter to a Java String value. The driver converts this to a
SQL VARCHAR or LONGVARCHAR value (depending on the arguments size
relative to the driver's limits on VARCHARs) when it sends it to the
database.
- Specified by:
setStringin interfacejava.sql.PreparedStatement
setTime
public void setTime(int parameterIndex,
java.sql.Time x)
throws java.sql.SQLException
- 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.
- Specified by:
setTimein interfacejava.sql.PreparedStatement
setTime
public void setTime(int parameterIndex,
java.sql.Time x,
java.util.Calendar cal)
throws java.sql.SQLException
- 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.
- Specified by:
setTimein interfacejava.sql.PreparedStatement
setTimestamp
public void setTimestamp(int parameterIndex,
java.sql.Timestamp x)
throws java.sql.SQLException
- 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.
- Specified by:
setTimestampin interfacejava.sql.PreparedStatement
setTimestamp
public void setTimestamp(int parameterIndex,
java.sql.Timestamp x,
java.util.Calendar cal)
throws java.sql.SQLException
- 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.
- Specified by:
setTimestampin interfacejava.sql.PreparedStatement
setURL
public void setURL(int parameterIndex,
java.net.URL arg)
throws java.sql.SQLException
- Description copied from interface:
java.sql.PreparedStatement - This method sets the specified parameter from the given Java
java.net.URLvalue.- Specified by:
setURLin interfacejava.sql.PreparedStatement
setUnicodeStream
public void setUnicodeStream(int parameterIndex,
java.io.InputStream x,
int length)
throws java.sql.SQLException
- Deprecated.
- When a very large Unicode value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.
Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.
- Specified by:
setUnicodeStreamin interfacejava.sql.PreparedStatement
- When a very large Unicode value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.InputStream. JDBC will read the data from the stream as needed, until it reaches end-of-file. The JDBC driver will do any necessary conversion from UNICODE to the database char format.
addBatch
public void addBatch()
throws java.sql.SQLException
- JDBC 2.0 Add a set of parameters to the batch.
- Specified by:
addBatchin interfacejava.sql.PreparedStatement
clearParameters
public void clearParameters()
throws java.sql.SQLException
- In general, parameter values remain in force for repeated used of a
Statement. Setting a parameter value automatically clears its previous
value. However, in some cases, it is useful to immediately release the
resources used by the current parameter values; this can be done by
calling clearParameters
- Specified by:
clearParametersin interfacejava.sql.PreparedStatement
close
public void close()
throws java.sql.SQLException
- Closes this prepared statement and releases all resources.
- Specified by:
closein interfacejava.sql.Statement- Overrides:
closein classStatement
execute
public boolean execute()
throws java.sql.SQLException
- Some prepared statements return multiple results; the execute method
handles these complex statements as well as the simpler form of
statements handled by executeQuery and executeUpdate
- Specified by:
executein interfacejava.sql.PreparedStatement
executeBatch
public int[] executeBatch()
throws java.sql.SQLException
- JDBC 2.0 Submit a batch of commands to the database for execution. This
method is optional.
- Specified by:
executeBatchin interfacejava.sql.Statement- Overrides:
executeBatchin classStatement
executeQuery
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
- A Prepared SQL query is executed and its ResultSet is returned
- Specified by:
executeQueryin interfacejava.sql.PreparedStatement
executeUpdate
public int executeUpdate()
throws java.sql.SQLException
- Execute a SQL INSERT, UPDATE or DELETE statement. In addition, SQL
statements that return nothing such as SQL DDL statements can be
executed.
- Specified by:
executeUpdatein interfacejava.sql.PreparedStatement
toString
public java.lang.String toString()
- Returns this PreparedStatement represented as a string.
setBytesNoEscape
protected void setBytesNoEscape(int parameterIndex,
byte[] parameterAsBytes)
throws java.sql.SQLException
- Used by updatable result sets for refreshRow() because the parameter has
already been escaped for updater or inserter prepared statements.
setRetrieveGeneratedKeys
protected void setRetrieveGeneratedKeys(boolean retrieveGeneratedKeys)
- Sets wheather or not this statement should retreive generated keys.
executeUpdate
protected int executeUpdate(byte[][] batchedParameterStrings,
java.io.InputStream[] batchedParameterStreams,
boolean[] batchedIsStream,
int[] batchedStreamLengths,
boolean[] batchedIsNull)
throws java.sql.SQLException
- Added to allow batch-updates
getBytes
byte[] getBytes(int parameterIndex)
throws java.sql.SQLException
isNull
boolean isNull(int paramIndex)
getParseInfo
PreparedStatement.ParseInfo getParseInfo()
setResultSetConcurrency
void setResultSetConcurrency(int concurrencyFlag)
- Sets the concurrency for result sets generated by this statement
- Overrides:
setResultSetConcurrencyin classStatement
setResultSetType
void setResultSetType(int typeFlag)
- Sets the result set type for result sets generated by this statement
- Overrides:
setResultSetTypein classStatement
getDateTimePattern
private final java.lang.String getDateTimePattern(java.lang.String dt, boolean toTime) throws java.lang.Exception
setInternal
private final void setInternal(int paramIndex,
byte[] val)
throws java.sql.SQLException
setInternal
private final void setInternal(int paramIndex,
java.lang.String val)
throws java.sql.SQLException
setSerializableObject
private final void setSerializableObject(int parameterIndex,
java.lang.Object parameterObj)
throws java.sql.SQLException
- Sets the value for the placeholder as a serialized Java object (used by
various forms of setObject()
getSuccessor
private final char getSuccessor(char c,
int n)
setTimeInternal
private void setTimeInternal(int parameterIndex,
java.sql.Time x,
java.util.TimeZone tz)
throws java.sql.SQLException
- 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.
setTimestampInternal
private void setTimestampInternal(int parameterIndex,
java.sql.Timestamp x,
java.util.TimeZone tz)
throws java.sql.SQLException
- 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.
escapeblockFast
private final void escapeblockFast(byte[] buf,
java.io.ByteArrayOutputStream bytesOut,
int size)
escapeblockFast
private final void escapeblockFast(byte[] buf,
Buffer packet,
int size)
throws java.sql.SQLException
fillSendPacket
private Buffer fillSendPacket() throws java.sql.SQLException
- Creates the packet that contains the query to be sent to the server.
fillSendPacket
private Buffer fillSendPacket(byte[][] batchedParameterStrings, java.io.InputStream[] batchedParameterStreams, boolean[] batchedIsStream, int[] batchedStreamLengths) throws java.sql.SQLException
- Creates the packet that contains the query to be sent to the server.
fixDecimalExponent
private static final java.lang.String fixDecimalExponent(java.lang.String dString)
initializeFromParseInfo
private void initializeFromParseInfo()
throws java.sql.SQLException
readblock
private final int readblock(java.io.InputStream i, byte[] b, int length) throws java.sql.SQLException
readblock
private final int readblock(java.io.InputStream i, byte[] b) throws java.sql.SQLException
streamToBytes
private final byte[] streamToBytes(java.io.InputStream in, int streamLength, boolean useLength) throws java.sql.SQLException
- For the setXXXStream() methods. Basically converts an InputStream into a
String. Not very efficient, but it works.
streamToBytes
private final byte[] streamToBytes(java.io.InputStream in, boolean escape, int streamLength, boolean useLength) throws java.sql.SQLException
streamToBytes
private final void streamToBytes(Buffer packet, java.io.InputStream in, boolean escape, int streamLength, boolean useLength) throws java.sql.SQLException
readFully
private static int readFully(java.io.Reader reader, char[] buf, int length) throws java.io.IOException
- Reads length bytes from reader into buf. Blocks until enough input is
available
|
|||||||||
| Home >> All >> com >> mysql >> [ jdbc overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC