PreparedStatement (Java SE 25 & JDK 25)
- All Superinterfaces:
AutoCloseable, Statement, Wrapper
- All Known Subinterfaces:
CallableStatement
-
Field Summary
-
Method Summary
voidaddBatch()Adds a set of parameters to this
PreparedStatementobject's batch of commands.voidClears the current parameter values immediately.
booleanexecute()Executes the SQL statement in this
PreparedStatementobject, which may be any kind of SQL statement.default longExecutes the SQL statement in this
PreparedStatementobject, which must be an SQL Data Manipulation Language (DML) statement, such asINSERT,UPDATEorDELETE; or an SQL statement that returns nothing, such as a DDL statement.Executes the SQL query in this
PreparedStatementobject and returns theResultSetobject generated by the query.intExecutes the SQL statement in this
PreparedStatementobject, which must be an SQL Data Manipulation Language (DML) statement, such asINSERT,UPDATEorDELETE; or an SQL statement that returns nothing, such as a DDL statement.Retrieves a
ResultSetMetaDataobject that contains information about the columns of theResultSetobject that will be returned when thisPreparedStatementobject is executed.Retrieves the number, types and properties of this
PreparedStatementobject's parameters.voidsetArray(int parameterIndex, Array x) Sets the designated parameter to the given
java.sql.Arrayobject.voidSets the designated parameter to the given input stream.
voidsetAsciiStream(int parameterIndex, InputStream x, int length) Sets the designated parameter to the given input stream, which will have the specified number of bytes.
voidsetAsciiStream(int parameterIndex, InputStream x, long length) Sets the designated parameter to the given input stream, which will have the specified number of bytes.
voidSets the designated parameter to the given
java.math.BigDecimalvalue.voidSets the designated parameter to the given input stream.
voidSets the designated parameter to the given input stream, which will have the specified number of bytes.
voidsetBinaryStream(int parameterIndex, InputStream x, long length) Sets the designated parameter to the given input stream, which will have the specified number of bytes.
voidSets the designated parameter to a
InputStreamobject.voidsetBlob(int parameterIndex, InputStream inputStream, long length) Sets the designated parameter to a
InputStreamobject.voidsetBlob(int parameterIndex, Blob x) Sets the designated parameter to the given
java.sql.Blobobject.voidsetBoolean(int parameterIndex, boolean x) Sets the designated parameter to the given Java
booleanvalue.voidsetByte(int parameterIndex, byte x) Sets the designated parameter to the given Java
bytevalue.voidsetBytes(int parameterIndex, byte[] x) Sets the designated parameter to the given Java array of bytes.
voidsetCharacterStream(int parameterIndex, Reader reader) Sets the designated parameter to the given
Readerobject.voidsetCharacterStream(int parameterIndex, Reader reader, int length) Sets the designated parameter to the given
Readerobject, which is the given number of characters long.voidsetCharacterStream(int parameterIndex, Reader reader, long length) Sets the designated parameter to the given
Readerobject, which is the given number of characters long.voidsetClob(int parameterIndex, Reader reader) Sets the designated parameter to a
Readerobject.voidsetClob(int parameterIndex, Reader reader, long length) Sets the designated parameter to a
Readerobject.voidsetClob(int parameterIndex, Clob x) Sets the designated parameter to the given
java.sql.Clobobject.voidsetDate(int parameterIndex, Date x) Sets the designated parameter to the given
java.sql.Datevalue using the default time zone of the virtual machine that is running the application.voidSets the designated parameter to the given
java.sql.Datevalue, using the givenCalendarobject.voidsetDouble(int parameterIndex, double x) Sets the designated parameter to the given Java
doublevalue.voidsetFloat(int parameterIndex, float x) Sets the designated parameter to the given Java
floatvalue.voidsetInt(int parameterIndex, int x) Sets the designated parameter to the given Java
intvalue.voidsetLong(int parameterIndex, long x) Sets the designated parameter to the given Java
longvalue.voidsetNCharacterStream(int parameterIndex, Reader value) Sets the designated parameter to a
Readerobject.voidsetNCharacterStream(int parameterIndex, Reader value, long length) Sets the designated parameter to a
Readerobject.voidsetNClob(int parameterIndex, Reader reader) Sets the designated parameter to a
Readerobject.voidsetNClob(int parameterIndex, Reader reader, long length) Sets the designated parameter to a
Readerobject.voidsetNClob(int parameterIndex, NClob value) Sets the designated parameter to a
java.sql.NClobobject.voidsetNString(int parameterIndex, String value) Sets the designated parameter to the given
Stringobject.voidsetNull(int parameterIndex, int sqlType) Sets the designated parameter to SQL
NULL.voidsetNull(int parameterIndex, int sqlType, String typeName) Sets the designated parameter to SQL
NULL.voidsetObject(int parameterIndex, Object x) Sets the value of the designated parameter using the given object.
voidsetObject(int parameterIndex, Object x, int targetSqlType) Sets the value of the designated parameter with the given object.
voidsetObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) Sets the value of the designated parameter with the given object.
default voidSets the value of the designated parameter with the given object.
default voidsetObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) Sets the value of the designated parameter with the given object.
voidsetRef(int parameterIndex, Ref x) Sets the designated parameter to the given
REF(<structured-type>)value.voidsetRowId(int parameterIndex, RowId x) Sets the designated parameter to the given
java.sql.RowIdobject.voidsetShort(int parameterIndex, short x) Sets the designated parameter to the given Java
shortvalue.voidsetSQLXML(int parameterIndex, SQLXML xmlObject) Sets the designated parameter to the given
java.sql.SQLXMLobject.voidsetString(int parameterIndex, String x) Sets the designated parameter to the given Java
Stringvalue.voidsetTime(int parameterIndex, Time x) Sets the designated parameter to the given
java.sql.Timevalue.voidSets the designated parameter to the given
java.sql.Timevalue, using the givenCalendarobject.voidSets the designated parameter to the given
java.sql.Timestampvalue.voidSets the designated parameter to the given
java.sql.Timestampvalue, using the givenCalendarobject.voidvoidsetURL(int parameterIndex, URL x) Sets the designated parameter to the given
java.net.URLvalue.Methods declared in interface Statement
addBatch, cancel, clearBatch, clearWarnings, close, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatch, 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, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
-
Method Details
-
executeQuery
-
executeUpdate
-
setNull
-
setBoolean
-
setByte
-
setShort
-
setInt
-
setLong
-
setFloat
-
setDouble
-
setBigDecimal
-
setString
-
setBytes
-
setDate
-
setTime
-
setTimestamp
-
setAsciiStream
-
setUnicodeStream
-
setBinaryStream
-
clearParameters
-
setObject
-
setObject
-
execute
-
addBatch
-
setCharacterStream
-
setRef
-
setBlob
-
setClob
-
setArray
-
getMetaData
-
setDate
-
setTime
-
setTimestamp
-
setNull
-
setURL
-
getParameterMetaData
-
setRowId
-
setNString
-
setNCharacterStream
-
setNClob
-
setClob
-
setBlob
-
setNClob
-
setSQLXML
-
setObject
-
setAsciiStream
-
setBinaryStream
-
setCharacterStream
-
setAsciiStream
-
setBinaryStream
-
setCharacterStream
-
setNCharacterStream
-
setClob
-
setBlob
-
setNClob
-
setObject
-
setObject
-
executeLargeUpdate
-