public class MySQLServerPreparedStatement extends AbstractMySQLPrepareStatement
batchResultSet, firstRewrite, isRewriteable, protocol, queryResult, stLock, timerTaskCLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO| Constructor and Description |
|---|
MySQLServerPreparedStatement(MySQLConnection connection,
String sql) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch() |
protected Calendar |
cal() |
void |
clearBatch()
Empties this
Statement object's current list of SQL commands. |
void |
clearParameters() |
void |
close()
Releases this
Statement object's database and JDBC resources immediately instead of waiting for this
to happen when it is automatically closed. |
boolean |
execute() |
int[] |
executeBatch()
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an
array of update counts.
|
ResultSet |
executeQuery() |
int |
executeUpdate() |
ResultSetMetaData |
getMetaData() |
ParameterMetaData |
getParameterMetaData()
Retrieves the number, types and properties of this
PreparedStatement object's parameters. |
protected boolean |
isNoBackslashEscapes() |
protected void |
setParameter(int parameterIndex,
ParameterHolder holder) |
String |
toString() |
protected boolean |
useFractionalSeconds() |
setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFloat, setInt, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setNull, setObject, setObject, setObject, setRef, setRowId, setShort, setSQLXML, setString, setTime, setTime, setTimestamp, setTimestamp, setUnicodeStream, setURLaddBatch, cacheMoreResults, cancel, clearWarnings, closeOnCompletion, execute, execute, execute, execute, execute, execute, executeQuery, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getInsertIncipit, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getMoreResults, getProtocol, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getUpdateCounts, getUpdateCountsForReWrittenBatch, getWarnings, isClosed, isCloseOnCompletion, isInsertRewriteable, isPoolable, isStreaming, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLocalInfileInputStream, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unloadDriver, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecuteLargeUpdate, setObject, setObjectaddBatch, cancel, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutisWrapperFor, unwrappublic MySQLServerPreparedStatement(MySQLConnection connection, String sql) throws SQLException
SQLExceptionprotected boolean isNoBackslashEscapes()
isNoBackslashEscapes in class AbstractMySQLPrepareStatementprotected boolean useFractionalSeconds()
useFractionalSeconds in class AbstractMySQLPrepareStatementprotected Calendar cal()
cal in class AbstractMySQLPrepareStatementprotected void setParameter(int parameterIndex,
ParameterHolder holder)
throws SQLException
setParameter in class AbstractMySQLPrepareStatementSQLExceptionpublic void addBatch()
throws SQLException
SQLExceptionpublic void clearBatch()
MySQLStatementStatement object's current list of SQL commands.clearBatch in interface StatementclearBatch in class MySQLStatementMySQLStatement.addBatch(java.lang.String),
DatabaseMetaData.supportsBatchUpdates()public ParameterMetaData getParameterMetaData() throws SQLException
AbstractMySQLPrepareStatementPreparedStatement object's parameters.getParameterMetaData in interface PreparedStatementgetParameterMetaData in class AbstractMySQLPrepareStatementParameterMetaData object that contains information about the number, types and properties
for each parameter marker of this PreparedStatement objectSQLException - if a database access error occurs or this method is called on a closed
PreparedStatementParameterMetaDatapublic ResultSetMetaData getMetaData() throws SQLException
SQLExceptionpublic int[] executeBatch()
throws SQLException
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an
array of update counts. The int elements of the array that is returned are ordered to correspond to
the commands in the batch, which are ordered according to the order in which they were added to the batch. The
elements in the array returned by the method executeBatch may be one of the following:
SUCCESS_NO_INFO -- indicates that the command was processed successfully but that the number of rows
affected is unknown
If one of the commands in a batch update fails to execute properly, this method throws a
BatchUpdateException, and a JDBC driver may or may not continue to process the remaining commands in
the batch. However, the driver's behavior must be consistent with a particular DBMS, either always continuing to
process commands or never continuing to process commands. If the driver continues processing after a failure,
the array returned by the method BatchUpdateException.getUpdateCounts will contain as many elements
as there are commands in the batch, and at least one of the elements will be the following:
EXECUTE_FAILED -- indicates that the command failed to execute successfully and
occurs only if a driver continues to process commands after a command fails BatchUpdateException object has been thrown.executeBatch in interface StatementexecuteBatch in class MySQLStatementSQLException - if a database access error occurs, this method is called on a closed
Statement or the driver does not support batch statements. Throws
BatchUpdateException (a subclass of SQLException) if
one of the commands sent to the database fails to execute properly or attempts to
return a result set.addBatch(),
DatabaseMetaData.supportsBatchUpdates()public ResultSet executeQuery() throws SQLException
SQLExceptionpublic int executeUpdate()
throws SQLException
SQLExceptionpublic void clearParameters()
throws SQLException
SQLExceptionpublic boolean execute()
throws SQLException
SQLExceptionpublic void close()
throws SQLException
Releases this Statement object's database and JDBC resources immediately instead of waiting for this
to happen when it is automatically closed. It is generally good practice to release resources as soon as you are
finished with them to avoid tying up database resources.
Calling the method close on a Statement object that is already closed has no effect.
Note:When a Statement object is closed, its current ResultSet object, if one
exists, is also closed.
close in interface AutoCloseableclose in interface Statementclose in class MySQLStatementSQLException - if a database access error occursCopyright © 2015. All rights reserved.