IPreparedStatement Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
An object that represents a precompiled SQL statement.
[Android.Runtime.Register("java/sql/PreparedStatement", "", "Java.Sql.IPreparedStatementInvoker")]
public interface IPreparedStatement : IDisposable, Java.Interop.IJavaPeerable, Java.Sql.IStatement
[<Android.Runtime.Register("java/sql/PreparedStatement", "", "Java.Sql.IPreparedStatementInvoker")>]
type IPreparedStatement = interface
interface IStatement
interface IWrapper
interface IJavaObject
interface IDisposable
interface IJavaPeerable
- Derived
- Attributes
- Implements
Remarks
An object that represents a precompiled SQL statement.
A SQL statement is precompiled and stored in a PreparedStatement
object. This object can then be used to efficiently execute this statement multiple times.
<B>Note:</B> The setter methods (setShort
, setString
, and so on) 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 the method setInt
should be used.
If arbitrary parameter type conversions are required, the method setObject
should be used with a target SQL type.
In the following example of setting a parameter, con
represents an active connection:
PreparedStatement pstmt = con.prepareStatement("UPDATE EMPLOYEES
SET SALARY = ? WHERE ID = ?");
pstmt.setBigDecimal(1, 153833.00)
pstmt.setInt(2, 110592)
Java documentation for java.sql.PreparedStatement
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Fields
CloseAllResults |
The constant indicating that all |
CloseCurrentResult |
The constant indicating that the current |
ExecuteFailed |
The constant indicating that an error occured while executing a batch statement. (Inherited from IStatement) |
KeepCurrentResult |
The constant indicating that the current |
NoGeneratedKeys |
The constant indicating that generated keys should not be made available for retrieval. (Inherited from IStatement) |
ReturnGeneratedKeys |
The constant indicating that generated keys should be made available for retrieval. (Inherited from IStatement) |
SuccessNoInfo |
The constant indicating that a batch statement executed successfully but that no count of the number of rows it affected is available. (Inherited from IStatement) |
Properties
Connection |
Gets the |
FetchDirection |
Gets the default direction for fetching rows for |
FetchSize |
Gets the default number of rows for a fetch for the |
GeneratedKeys |
Returns auto generated keys created by executing this statement. (Inherited from IStatement) |
Handle |
Gets the JNI value of the underlying Android object. (Inherited from IJavaObject) |
IsClosed |
Returns true if this statement has been closed, false otherwise. (Inherited from IStatement) |
JniIdentityHashCode |
Returns the value of |
JniManagedPeerState |
State of the managed peer. (Inherited from IJavaPeerable) |
JniPeerMembers |
Member access and invocation support. (Inherited from IJavaPeerable) |
MaxFieldSize |
Gets the maximum number of bytes which can be returned as values from
character and binary type columns in a |
MaxRows |
Gets the maximum number of rows that a |
MetaData |
Returns a |
MoreResults |
Moves to this statement's next result. (Inherited from IStatement) |
ParameterMetaData |
Gets information about the parameters of the |
PeerReference |
Returns a JniObjectReference of the wrapped Java object instance. (Inherited from IJavaPeerable) |
Poolable |
Returns true if this statement is poolable, false otherwise. (Inherited from IStatement) |
QueryTimeout |
Gets the timeout value for the statement's execution time. (Inherited from IStatement) |
ResultSet |
Gets the current result. (Inherited from IStatement) |
ResultSetConcurrency |
Gets the concurrency setting for |
ResultSetHoldability |
Gets the cursor hold setting for |
ResultSetType |
Gets the |
UpdateCount |
Gets an update count for the current result if it is not a |
Warnings |
Retrieves the first |
Methods
AddBatch() |
Adds a set of parameters to this |
AddBatch(String) |
Adds the given SQL command to the current list of commmands for this
|
Cancel() |
Cancels this |
ClearBatch() |
Empties this |
ClearParameters() |
Clears the current parameter values immediately. |
ClearWarnings() |
Clears all the warnings reported on this |
Close() |
Releases this |
Disposed() |
Called when the instance has been disposed. (Inherited from IJavaPeerable) |
DisposeUnlessReferenced() |
If there are no outstanding references to this instance, then
calls |
Execute() |
Executes the SQL statement in this |
Execute(String) |
Executes the given SQL statement, which may return multiple results. (Inherited from IStatement) |
Execute(String, Int32) |
Executes the given SQL statement, which may return multiple results, and signals the driver that any auto-generated keys should be made available for retrieval. (Inherited from IStatement) |
Execute(String, Int32[]) |
Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. (Inherited from IStatement) |
Execute(String, String[]) |
Executes the given SQL statement, which may return multiple results, and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. (Inherited from IStatement) |
ExecuteBatch() |
Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts. (Inherited from IStatement) |
ExecuteQuery() |
Executes the SQL query in this |
ExecuteQuery(String) |
Executes the given SQL statement, which returns a single
|
ExecuteUpdate() |
Executes the SQL statement in this |
ExecuteUpdate(String) |
Executes the given SQL statement, which may be an |
ExecuteUpdate(String, Int32) |
Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this |
ExecuteUpdate(String, Int32[]) |
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. (Inherited from IStatement) |
ExecuteUpdate(String, String[]) |
Executes the given SQL statement and signals the driver that the auto-generated keys indicated in the given array should be made available for retrieval. (Inherited from IStatement) |
Finalized() |
Called when the instance has been finalized. (Inherited from IJavaPeerable) |
GetMoreResults(Int32) |
Moves to this |
IsWrapperFor(Class) |
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. (Inherited from IWrapper) |
SetArray(Int32, IArray) |
Sets the designated parameter to the given |
SetAsciiStream(Int32, Stream) |
Sets the designated parameter to the given input stream. |
SetAsciiStream(Int32, Stream, Int32) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
SetAsciiStream(Int32, Stream, Int64) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
SetBigDecimal(Int32, BigDecimal) |
Sets the designated parameter to the given |
SetBinaryStream(Int32, Stream) |
Sets the designated parameter to the given input stream. |
SetBinaryStream(Int32, Stream, Int32) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
SetBinaryStream(Int32, Stream, Int64) |
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
SetBlob(Int32, IBlob) |
Sets the designated parameter to the given |
SetBlob(Int32, Stream) |
Sets the designated parameter to a |
SetBlob(Int32, Stream, Int64) |
Sets the designated parameter to a |
SetBoolean(Int32, Boolean) |
Sets the designated parameter to the given Java |
SetByte(Int32, SByte) |
Sets the designated parameter to the given Java |
SetBytes(Int32, Byte[]) |
Sets the designated parameter to the given Java array of bytes. |
SetCharacterStream(Int32, Reader) |
Sets the designated parameter to the given |
SetCharacterStream(Int32, Reader, Int32) |
Sets the designated parameter to the given |
SetCharacterStream(Int32, Reader, Int64) |
Sets the designated parameter to the given |
SetClob(Int32, IClob) |
Sets the designated parameter to the given |
SetClob(Int32, Reader) |
Sets the designated parameter to a |
SetClob(Int32, Reader, Int64) |
Sets the designated parameter to a |
SetCursorName(String) |
Sets the SQL cursor name to the given |
SetDate(Int32, Date) |
Sets the designated parameter to the given |
SetDate(Int32, Date, Calendar) |
Sets the designated parameter to the given |
SetDouble(Int32, Double) |
Sets the designated parameter to the given Java |
SetEscapeProcessing(Boolean) |
Sets escape processing on or off. (Inherited from IStatement) |
SetFloat(Int32, Single) |
Sets the designated parameter to the given Java |
SetInt(Int32, Int32) |
Sets the designated parameter to the given Java |
SetJniIdentityHashCode(Int32) |
Set the value returned by |
SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from IJavaPeerable) |
SetLong(Int32, Int64) |
Sets the designated parameter to the given Java |
SetNCharacterStream(Int32, Reader) |
Sets the designated parameter to a |
SetNCharacterStream(Int32, Reader, Int64) |
Sets the designated parameter to a |
SetNClob(Int32, INClob) |
Sets the designated parameter to a |
SetNClob(Int32, Reader) |
Sets the designated parameter to a |
SetNClob(Int32, Reader, Int64) |
Sets the designated parameter to a |
SetNString(Int32, String) |
Sets the designated paramter to the given |
SetNull(Int32, Int32) |
Sets the designated parameter to SQL |
SetNull(Int32, Int32, String) |
Sets the designated parameter to SQL |
SetObject(Int32, Object) |
Sets the value of the designated parameter using the given object. |
SetObject(Int32, Object, Int32) |
Sets the value of the designated parameter with the given object. |
SetObject(Int32, Object, Int32, Int32) |
Sets the value of the designated parameter with the given object. |
SetPeerReference(JniObjectReference) |
Set the value returned by |
SetRef(Int32, IRef) |
Sets the designated parameter to the given
|
SetRowId(Int32, IRowId) |
Sets the designated parameter to the given |
SetShort(Int32, Int16) |
Sets the designated parameter to the given Java |
SetSQLXML(Int32, ISQLXML) |
Sets the designated parameter to the given |
SetString(Int32, String) |
Sets the designated parameter to the given Java |
SetTime(Int32, Time) |
Sets the designated parameter to the given |
SetTime(Int32, Time, Calendar) |
Sets the designated parameter to the given |
SetTimestamp(Int32, Timestamp) |
Sets the designated parameter to the given |
SetTimestamp(Int32, Timestamp, Calendar) |
Sets the designated parameter to the given |
SetUnicodeStream(Int32, Stream, Int32) |
Obsolete.
Sets the designated parameter to the given input stream, which will have the specified number of bytes. |
SetURL(Int32, URL) |
Sets the designated parameter to the given |
UnregisterFromRuntime() |
Unregister this instance so that the runtime will not return it from future Java.Interop.JniRuntime+JniValueManager.PeekValue invocations. (Inherited from IJavaPeerable) |
Unwrap(Class) |
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. (Inherited from IWrapper) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |