public class JdbcPreparedStatement extends JdbcStatement implements PreparedStatement
| 限定符和类型 | 字段和说明 |
|---|---|
protected CommandInterface |
command |
closedByResultSet, conn, fetchSize, maxRows, resultSet, resultSetConcurrency, resultSetType, session, updateCountARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, STATEMENT, trace, XA_DATA_SOURCE, XID| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch()
Adds the current settings to the batch.
|
void |
addBatch(String sql)
Calling this method is not legal on a PreparedStatement.
|
protected boolean |
checkClosed(boolean write)
INTERNAL.
|
void |
clearBatch()
Clears the batch.
|
void |
clearParameters()
Clears all parameters.
|
void |
close()
Closes this statement.
|
boolean |
execute()
Executes an arbitrary statement.
|
boolean |
execute(String sql)
Calling this method is not legal on a PreparedStatement.
|
boolean |
execute(String sql,
int autoGeneratedKeys)
Calling this method is not legal on a PreparedStatement.
|
boolean |
execute(String sql,
int[] columnIndexes)
Calling this method is not legal on a PreparedStatement.
|
boolean |
execute(String sql,
String[] columnNames)
Calling this method is not legal on a PreparedStatement.
|
int[] |
executeBatch()
Executes the batch.
|
ResultSet |
executeQuery()
Executes a query (select statement) and returns the result set.
|
ResultSet |
executeQuery(String sql)
Calling this method is not legal on a PreparedStatement.
|
int |
executeUpdate()
Executes a statement (insert, update, delete, create, drop)
and returns the update count.
|
int |
executeUpdate(String sql)
Calling this method is not legal on a PreparedStatement.
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Calling this method is not legal on a PreparedStatement.
|
int |
executeUpdate(String sql,
int[] columnIndexes)
Calling this method is not legal on a PreparedStatement.
|
int |
executeUpdate(String sql,
String[] columnNames)
Calling this method is not legal on a PreparedStatement.
|
ResultSet |
getGeneratedKeys()
Return a result set that contains the last generated auto-increment key
for this connection, if there was one.
|
ResultSetMetaData |
getMetaData()
Gets the result set metadata of the query returned when the statement is
executed.
|
ParameterMetaData |
getParameterMetaData()
Get the parameter meta data of this prepared statement.
|
void |
setArray(int parameterIndex,
Array x)
[Not supported] Sets the value of a parameter as a Array.
|
void |
setAsciiStream(int parameterIndex,
InputStream x)
Sets the value of a parameter as an ASCII stream.
|
void |
setAsciiStream(int parameterIndex,
InputStream x,
int length)
Sets the value of a parameter as an ASCII stream.
|
void |
setAsciiStream(int parameterIndex,
InputStream x,
long length)
Sets the value of a parameter as an ASCII stream.
|
void |
setBigDecimal(int parameterIndex,
BigDecimal x)
Sets the value of a parameter.
|
void |
setBinaryStream(int parameterIndex,
InputStream x)
Sets the value of a parameter as an input stream.
|
void |
setBinaryStream(int parameterIndex,
InputStream x,
int length)
Sets the value of a parameter as an input stream.
|
void |
setBinaryStream(int parameterIndex,
InputStream x,
long length)
Sets the value of a parameter as an input stream.
|
void |
setBlob(int parameterIndex,
Blob x)
Sets the value of a parameter as a Blob.
|
void |
setBlob(int parameterIndex,
InputStream x)
Sets the value of a parameter as a Blob.
|
void |
setBlob(int parameterIndex,
InputStream x,
long length)
Sets the value of a parameter as a Blob.
|
void |
setBoolean(int parameterIndex,
boolean x)
Sets the value of a parameter.
|
void |
setByte(int parameterIndex,
byte x)
Sets the value of a parameter.
|
void |
setBytes(int parameterIndex,
byte[] x)
Sets the value of a parameter as a byte array.
|
void |
setCharacterStream(int parameterIndex,
Reader x)
Sets the value of a parameter as a character stream.
|
void |
setCharacterStream(int parameterIndex,
Reader x,
int length)
Sets the value of a parameter as a character stream.
|
void |
setCharacterStream(int parameterIndex,
Reader x,
long length)
Sets the value of a parameter as a character stream.
|
void |
setClob(int parameterIndex,
Clob x)
Sets the value of a parameter as a Clob.
|
void |
setClob(int parameterIndex,
Reader x)
Sets the value of a parameter as a Clob.
|
void |
setClob(int parameterIndex,
Reader x,
long length)
Sets the value of a parameter as a Clob.
|
void |
setDate(int parameterIndex,
Date x)
Sets the value of a parameter.
|
void |
setDate(int parameterIndex,
Date x,
Calendar calendar)
Sets the date using a specified time zone.
|
void |
setDouble(int parameterIndex,
double x)
Sets the value of a parameter.
|
void |
setFloat(int parameterIndex,
float x)
Sets the value of a parameter.
|
void |
setInt(int parameterIndex,
int x)
Sets the value of a parameter.
|
void |
setLong(int parameterIndex,
long x)
Sets the value of a parameter.
|
void |
setNCharacterStream(int parameterIndex,
Reader x)
Sets the value of a parameter as a character stream.
|
void |
setNCharacterStream(int parameterIndex,
Reader x,
long length)
Sets the value of a parameter as a character stream.
|
void |
setNClob(int parameterIndex,
NClob x)
Sets the value of a parameter as a Clob.
|
void |
setNClob(int parameterIndex,
Reader x)
Sets the value of a parameter as a Clob.
|
void |
setNClob(int parameterIndex,
Reader x,
long length)
Sets the value of a parameter as a Clob.
|
void |
setNString(int parameterIndex,
String x)
Sets the value of a parameter.
|
void |
setNull(int parameterIndex,
int sqlType)
Sets a parameter to null.
|
void |
setNull(int parameterIndex,
int sqlType,
String typeName)
Sets a parameter to null.
|
void |
setObject(int parameterIndex,
Object x)
Sets the value of a parameter.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType)
Sets the value of a parameter.
|
void |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
Sets the value of a parameter.
|
void |
setRef(int parameterIndex,
Ref x)
[Not supported] Sets the value of a column as a reference.
|
void |
setRowId(int parameterIndex,
RowId x)
[Not supported] Sets the value of a parameter as a row id.
|
void |
setShort(int parameterIndex,
short x)
Sets the value of a parameter.
|
void |
setSQLXML(int parameterIndex,
SQLXML x)
[Not supported] Sets the value of a parameter as a SQLXML object.
|
void |
setString(int parameterIndex,
String x)
Sets the value of a parameter.
|
void |
setTime(int parameterIndex,
Time x)
Sets the value of a parameter.
|
void |
setTime(int parameterIndex,
Time x,
Calendar calendar)
Sets the time using a specified time zone.
|
void |
setTimestamp(int parameterIndex,
Timestamp x)
Sets the value of a parameter.
|
void |
setTimestamp(int parameterIndex,
Timestamp x,
Calendar calendar)
Sets the timestamp using a specified time zone.
|
void |
setUnicodeStream(int parameterIndex,
InputStream x,
int length)
已过时。
since JDBC 2.0, use setCharacterStream
|
void |
setURL(int parameterIndex,
URL x)
[Not supported]
|
String |
toString()
INTERNAL
|
cancel, clearWarnings, closeOldResultSet, closeOnCompletion, getConnection, getFetchDirection, getFetchSize, getLastExecutedCommandType, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isWrapperFor, setCursorName, setEscapeProcessing, setExecutingStatement, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrap, wasCancelleddebugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupportedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecuteLargeUpdate, setObject, setObjectcancel, clearWarnings, closeOnCompletion, executeLargeBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, getConnection, getFetchDirection, getFetchSize, 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, unwrapprotected CommandInterface command
public ResultSet executeQuery() throws SQLException
executeQuery 在接口中 PreparedStatementSQLException - if this object is closed or invalidpublic int executeUpdate()
throws SQLException
executeUpdate 在接口中 PreparedStatementSQLException - if this object is closed or invalidpublic boolean execute()
throws SQLException
execute 在接口中 PreparedStatementSQLException - if this object is closed or invalidpublic void clearParameters()
throws SQLException
clearParameters 在接口中 PreparedStatementSQLException - if this object is closed or invalidpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery 在接口中 StatementexecuteQuery 在类中 JdbcStatementsql - ignoredSQLException - Unsupported Featurepublic void addBatch(String sql) throws SQLException
addBatch 在接口中 StatementaddBatch 在类中 JdbcStatementsql - ignoredSQLException - Unsupported Featurepublic int executeUpdate(String sql) throws SQLException
executeUpdate 在接口中 StatementexecuteUpdate 在类中 JdbcStatementsql - ignoredSQLException - Unsupported Featurepublic boolean execute(String sql) throws SQLException
execute 在接口中 Statementexecute 在类中 JdbcStatementsql - ignoredSQLException - Unsupported Featurepublic void setNull(int parameterIndex,
int sqlType)
throws SQLException
setNull 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)sqlType - the data type (Types.x)SQLException - if this object is closedpublic void setInt(int parameterIndex,
int x)
throws SQLException
setInt 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setString(int parameterIndex,
String x)
throws SQLException
setString 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setBigDecimal(int parameterIndex,
BigDecimal x)
throws SQLException
setBigDecimal 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setDate(int parameterIndex,
Date x)
throws SQLException
setDate 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setTime(int parameterIndex,
Time x)
throws SQLException
setTime 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setTimestamp(int parameterIndex,
Timestamp x)
throws SQLException
setTimestamp 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setObject(int parameterIndex,
Object x)
throws SQLException
setObject 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setObject(int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
setObject 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the value, null is allowedtargetSqlType - the type as defined in java.sql.TypesSQLException - if this object is closedpublic void setObject(int parameterIndex,
Object x,
int targetSqlType,
int scale)
throws SQLException
setObject 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the value, null is allowedtargetSqlType - the type as defined in java.sql.Typesscale - is ignoredSQLException - if this object is closedpublic void setBoolean(int parameterIndex,
boolean x)
throws SQLException
setBoolean 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setByte(int parameterIndex,
byte x)
throws SQLException
setByte 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setShort(int parameterIndex,
short x)
throws SQLException
setShort 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setLong(int parameterIndex,
long x)
throws SQLException
setLong 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setFloat(int parameterIndex,
float x)
throws SQLException
setFloat 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setDouble(int parameterIndex,
double x)
throws SQLException
setDouble 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setRef(int parameterIndex,
Ref x)
throws SQLException
setRef 在接口中 PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date x,
Calendar calendar)
throws SQLException
setDate 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuecalendar - the calendarSQLException - if this object is closedpublic void setTime(int parameterIndex,
Time x,
Calendar calendar)
throws SQLException
setTime 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuecalendar - the calendarSQLException - if this object is closedpublic void setTimestamp(int parameterIndex,
Timestamp x,
Calendar calendar)
throws SQLException
setTimestamp 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuecalendar - the calendarSQLException - if this object is closed@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
setUnicodeStream 在接口中 PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
setNull 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)sqlType - the data type (Types.x)typeName - this parameter is ignoredSQLException - if this object is closedpublic void setBlob(int parameterIndex,
Blob x)
throws SQLException
setBlob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setBlob(int parameterIndex,
InputStream x)
throws SQLException
setBlob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setClob(int parameterIndex,
Clob x)
throws SQLException
setClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setClob(int parameterIndex,
Reader x)
throws SQLException
setClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setArray(int parameterIndex,
Array x)
throws SQLException
setArray 在接口中 PreparedStatementSQLExceptionpublic void setBytes(int parameterIndex,
byte[] x)
throws SQLException
setBytes 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setBinaryStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setBinaryStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of bytesSQLException - if this object is closedpublic void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setBinaryStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of bytesSQLException - if this object is closedpublic void setBinaryStream(int parameterIndex,
InputStream x)
throws SQLException
setBinaryStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setAsciiStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setAsciiStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of bytesSQLException - if this object is closedpublic void setAsciiStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setAsciiStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of bytesSQLException - if this object is closedpublic void setAsciiStream(int parameterIndex,
InputStream x)
throws SQLException
setAsciiStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setCharacterStream(int parameterIndex,
Reader x,
int length)
throws SQLException
setCharacterStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of charactersSQLException - if this object is closedpublic void setCharacterStream(int parameterIndex,
Reader x)
throws SQLException
setCharacterStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setCharacterStream(int parameterIndex,
Reader x,
long length)
throws SQLException
setCharacterStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of charactersSQLException - if this object is closedpublic void setURL(int parameterIndex,
URL x)
throws SQLException
setURL 在接口中 PreparedStatementSQLExceptionpublic ResultSetMetaData getMetaData() throws SQLException
getMetaData 在接口中 PreparedStatementSQLException - if this object is closedpublic void clearBatch()
throws SQLException
clearBatch 在接口中 StatementclearBatch 在类中 JdbcStatementSQLExceptionpublic void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 Statementclose 在类中 JdbcStatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch 在接口中 StatementexecuteBatch 在类中 JdbcStatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
JdbcStatementgetGeneratedKeys 在接口中 StatementgetGeneratedKeys 在类中 JdbcStatementSQLException - if this object is closedpublic void addBatch()
throws SQLException
addBatch 在接口中 PreparedStatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate 在接口中 StatementexecuteUpdate 在类中 JdbcStatementsql - ignoredautoGeneratedKeys - ignoredSQLException - Unsupported Featurepublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate 在接口中 StatementexecuteUpdate 在类中 JdbcStatementsql - ignoredcolumnIndexes - ignoredSQLException - Unsupported Featurepublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate 在接口中 StatementexecuteUpdate 在类中 JdbcStatementsql - ignoredcolumnNames - ignoredSQLException - Unsupported Featurepublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute 在接口中 Statementexecute 在类中 JdbcStatementsql - ignoredautoGeneratedKeys - ignoredSQLException - Unsupported Featurepublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute 在接口中 Statementexecute 在类中 JdbcStatementsql - ignoredcolumnIndexes - ignoredSQLException - Unsupported Featurepublic boolean execute(String sql, String[] columnNames) throws SQLException
execute 在接口中 Statementexecute 在类中 JdbcStatementsql - ignoredcolumnNames - ignoredSQLException - Unsupported Featurepublic ParameterMetaData getParameterMetaData() throws SQLException
getParameterMetaData 在接口中 PreparedStatementSQLExceptionpublic void setRowId(int parameterIndex,
RowId x)
throws SQLException
setRowId 在接口中 PreparedStatementSQLExceptionpublic void setNString(int parameterIndex,
String x)
throws SQLException
setNString 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setNCharacterStream(int parameterIndex,
Reader x,
long length)
throws SQLException
setNCharacterStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of charactersSQLException - if this object is closedpublic void setNCharacterStream(int parameterIndex,
Reader x)
throws SQLException
setNCharacterStream 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setNClob(int parameterIndex,
NClob x)
throws SQLException
setNClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setNClob(int parameterIndex,
Reader x)
throws SQLException
setNClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valueSQLException - if this object is closedpublic void setClob(int parameterIndex,
Reader x,
long length)
throws SQLException
setClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of charactersSQLException - if this object is closedpublic void setBlob(int parameterIndex,
InputStream x,
long length)
throws SQLException
setBlob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of bytesSQLException - if this object is closedpublic void setNClob(int parameterIndex,
Reader x,
long length)
throws SQLException
setNClob 在接口中 PreparedStatementparameterIndex - the parameter index (1, 2, ...)x - the valuelength - the maximum number of charactersSQLException - if this object is closedpublic void setSQLXML(int parameterIndex,
SQLXML x)
throws SQLException
setSQLXML 在接口中 PreparedStatementSQLExceptionpublic String toString()
toString 在类中 JdbcStatementprotected boolean checkClosed(boolean write)
JdbcStatementcheckClosed 在类中 JdbcStatementwrite - if the next operation is possibly writingCopyright © 2017. All rights reserved.