Compartir a través de


SQLServerPreparedStatement Methods

The following tables list the methods that are exposed by the SQLServerPreparedStatement class.

Methods

Name Description

addBatch

Adds a set of parameters to the batch of commands for this Statement object.

cancel

(Inherited from SQLServerStatement) Cancels the SQL statement that is currently being run by this Statement object.

clearBatch

Empties the current list of SQL commands for this SQLServerStatement object.

clearParameters

Clears the current parameter values immediately.

clearWarnings

(Inherited from SQLServerStatement) Clears all the warnings that are reported on this Statement object.

close

Releases the database and JDBC resources of this Statement object immediately instead of waiting for them to be automatically released.

execute

Runs the SQL statement in this Statement object, which can be any kind of SQL statement.

executeBatch

Submits a batch of commands to the database to be run. If all commands run successfully, returns an array of update counts.

executeQuery

Runs the SQL query in this Statement object and returns the SQLServerResultSet object that is generated by the query.

executeUpdate

Runs the SQL statement in this Statement object, which must be an SQL INSERT, UPDATE or DELETE statement; or an SQL statement that returns nothing, such as a DDL statement.

getConnection

(Inherited from SQLServerStatement) Retrieves the SQLServerConnection object that produced this Statement object.

getFetchDirection

(Inherited from SQLServerStatement) Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

getFetchSize

(Inherited from SQLServerStatement) Retrieves the number of result set rows that is the default fetch size for result set objects generated from this Statement object.

getGeneratedKeys

(Inherited from SQLServerStatement) Retrieves any auto-generated keys that are created as a result of running this Statement object.

getMaxFieldSize

(Inherited from SQLServerStatement) Retrieves the maximum number of bytes that can be returned for character and binary column values in a SQLServerResultSet object produced by this Statement object.

getMaxRows

(Inherited from SQLServerStatement) Retrieves the maximum number of rows that a SQLServerResultSet object produced by this Statement object can contain.

getMetaData

Retrieves a SQLServerResultSetMetaData Class object that contains information about the columns of the SQLServerResultSet object that will be returned when this Statement object is executed.

getMoreResults

(Inherited from SQLServerStatement) Moves to the next result of this Statement object.

getParameterMetaData

Retrieves the number, types, and properties of the parameters for this Statement object.

getQueryTimeout

(Inherited from SQLServerStatement) Retrieves the number of seconds the Microsoft SQL Server 2005 JDBC Driver will wait for this Statement object to run.

getResultSet

(Inherited from SQLServerStatement) Retrieves the current result as a SQLServerResultSet object.

getResultSetConcurrency

(Inherited from SQLServerStatement) Retrieves the result set concurrency for SQLServerResultSet objects that are generated by this Statement object.

getResultSetHoldability

(Inherited from SQLServerStatement) Retrieves the result set holdability for SQLServerResultSet objects that are generated by this Statement object.

getResultSetType

(Inherited from SQLServerStatement) Retrieves the result set type for SQLServerResultSet objects that are generated by this Statement object.

getUpdateCount

(Inherited from SQLServerStatement) Retrieves the current result as an update count.

getWarnings

(Inherited from SQLServerStatement) Retrieves the first warning that is reported by calls on this Statement object.

setArray

Sets the designated parameter number to the given Array object.

setAsciiStream

Sets the designated parameter number to the given InputStream object with the given number of bytes.

setBigDecimal

Sets the designated parameter number to the given BigDecimal object.

setBinaryStream

Sets the designated parameter number to the given input stream, which will have the specified number of bytes.

setBlob

Sets the designated parameter to the given Blob object.

setboolean

Sets the designated parameter to the given boolean value.

setByte

Sets the designated parameter to the given byte value.

setBytes

Sets the designated parameter to the given array of bytes.

setCharacterStream

Sets the designated parameter to the given Reader object, which is the given number of characters long.

setClob

Sets the designated parameter to the given Clob object.

setCursorName

(Inherited from SQLServerStatement) Sets the SQL cursor name to the given String, which will be used by subsequent execute methods.

setDate

Sets the designated parameter to the given date value.

setDouble

Sets the designated parameter to the given double value.

setEscapeProcessing

(Inherited from SQLServerStatement) Sets the escape processing mode.

setFetchDirection

(Inherited from SQLServerStatement) Gives the JDBC driver a hint as to the direction in which result set rows should be processed.

setFetchSize

(Inherited from SQLServerStatement) Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.

setFloat

Sets the designated parameter to the given float value.

setInt

Sets the designated parameter to the given int value.

setLong

Sets the designated parameter to the given long value.

setMaxFieldSize

(Inherited from SQLServerStatement) Sets the limit for the maximum number of bytes in a SQLServerResultSet column storing character or binary values to the given number of bytes.

setMaxRows

(Inherited from SQLServerStatement) Sets the limit for the maximum number of rows that any SQLServerResultSet object can contain to the given number.

setNull

Sets the designated parameter to a null value, given the type of parameter to set.

setObject

Sets the value of the designated parameter using the given object.

setQueryTimeout

(Inherited from SQLServerStatement) Sets the number of seconds the driver will wait for a Statement object to run to the given number of seconds.

setRef

Sets the designated parameter to the given Ref object.

setShort

Sets the designated parameter to the given short value.

setString

Sets the designated parameter to the given String value.

setTime

Sets the designated parameter to the given time value.

setTimestamp

Sets the designated parameter to the given timestamp value.

setUnicodeStream

Sets the designated parameter number to the given input stream, which will have the specified number of bytes.

setURL

Sets the designated parameter to the given URL value.

Inherited Methods

Class inherited from: Methods

com.microsoft.sqlserver.jdbc.SQLServerStatement

cancel, clearWarnings, execute, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout

java.lang.Object

clone, equals, getClass, hashCode, notify, notifyAll, toString, wait

java.sql.Statement

cancel, clearWarnings, execute, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout

Vea también

Referencia

SQLServerPreparedStatement Class

Conceptos

SQLServerPreparedStatement Members