public class JDBC4ServerPreparedStatement extends BasePrepareStatement implements Cloneable
| 限定符和类型 | 字段和说明 |
|---|---|
protected Map<Integer,ParameterHolder> |
currentParameterHolder |
protected boolean |
isObFunction |
protected List<ParameterHolder[]> |
parametersList |
protected ServerPrepareResult |
serverPrepareResult |
autoGeneratedKeys, hasLongData, indexMap, parameterCount, SPEC_ISO_ZONED_DATE_TIMEactualSql, addRowid, batchQueries, canUseServerTimeout, connection, exceptionFactory, executing, fetchSize, isFetchSizeSet, isInternal, lock, lockLogger, maxRows, options, originalSql, protocol, queryTimeout, results, resultSetConcurrency, resultSetScrollType, selectEndPos, simpleSql, sqlType, status, STMT_ALTER, STMT_BEGIN, STMT_CALL, STMT_CREATE, STMT_DECLARE, STMT_DELETE, STMT_DROP, STMT_INSERT, STMT_SELECT, STMT_UNINITIALIZED, STMT_UNKNOWN, STMT_UPDATE, tableName, whereEndPos| 构造器和说明 |
|---|
JDBC4ServerPreparedStatement(boolean isObFunction,
OceanBaseConnection connection,
String sql,
int resultSetScrollType,
int resultSetConcurrency,
int autoGeneratedKeys,
ExceptionFactory exceptionFactory)
Constructor for creating Server prepared statement.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch() |
void |
addBatch(String sql)
Adds the given SQL command to the current list of commands for this
Statement
object. |
void |
clearBatch()
Empties this
Statement object's current list of SQL send. |
void |
clearParameters() |
JDBC4ServerPreparedStatement |
clone(OceanBaseConnection connection)
Clone statement.
|
void |
close()
Releases this
Statement object's database and JDBC resources immediately instead
of waiting for this to happen when it is automatically closed. |
void |
closeCursor(int cursorId) |
ColumnDefinition[] |
cursorFetch(int cursorId,
int fetchSize) |
ColumnDefinition[] |
cursorFetchForOracle(int cursorId,
int numRows,
byte offsetType,
int offset) |
boolean |
execute() |
int[] |
executeBatch()
Submits a batch of send to the database for execution and if all send execute successfully,
returns an array of update counts.
|
int[] |
executeBatchQuerys() |
protected boolean |
executeInternal(int fetchSize) |
long[] |
executeLargeBatch()
Execute batch, like executeBatch(), with returning results with long[].
|
long[] |
executeLargeBatchQuerys() |
long |
executeLargeUpdate() |
ResultSet |
executeQuery() |
int |
executeUpdate()
Executes the SQL statement in this
PreparedStatement object, which must be an SQL
Data Manipulation Language (DML) statement, such as INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing, such as a DDL statement. |
ResultSet |
getGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this
Statement
object. |
ResultSetMetaData |
getMetaData() |
ParameterMetaData |
getParameterMetaData()
Retrieves the number, types and properties of this
PreparedStatement object's
parameters. |
ParameterHolder[] |
getParameters() |
ResultSet |
getReturnResultSet() |
long |
getServerThreadId()
Permit to retrieve current connection thread id, or -1 if unknown.
|
protected boolean |
prepareExecuteInternal(int fetchSize) |
void |
realClose(boolean calledExplicitly,
boolean closeOpenResults) |
void |
registerReturnAutoGeneratedKey(AutoGeneratedKey autoGeneratedKey) |
void |
registerReturnParameter(int parameterIndex,
int externalType) |
void |
registerReturnParameter(int parameterIndex,
int externalType,
int maximumSize) |
void |
registerReturnParameter(int parameterIndex,
int externalType,
String internalTypeName) |
void |
setParameter(int parameterIndex,
ParameterHolder holder) |
void |
setParameters(ParameterHolder[] paramArray) |
String |
toString()
Return sql String value.
|
protected void |
validParameters() |
asSql, getParameterCount, setArray, setAsciiStream, setAsciiStream, setAsciiStream, setBigDecimal, setBINARY_DOUBLE, setBINARY_FLOAT, setBinaryStream, setBinaryStream, setBinaryStream, setBlob, setBlob, setBlob, setBoolean, setByte, setBytes, setCharacterStream, setCharacterStream, setCharacterStream, setClob, setClob, setClob, setDate, setDate, setDouble, setFixedCHAR, setFloat, setIndexMap, setInt, setINTERVALDS, setINTERVALYM, setLobLocator, setLocalDateTime, setLong, setNCharacterStream, setNCharacterStream, setNClob, setNClob, setNClob, setNString, setNull, setNull, setNull, setNUMBER_FLOAT, setNUMBER, setObject, setObject, setObject, setObject, setObject, setParameterCount, setRef, setRowId, setShort, setSQLXML, setString, setStruct, setTime, setTime, setTimestamp, setTIMESTAMP, setTimestamp, setTIMESTAMPLTZ, setTIMESTAMPTZ, setUnicodeStream, setURLcancel, checkClose, checkCloseOnCompletion, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeBatchEpilogue, executeBatchExceptionEpilogue, executeBatchExceptionEpilogue, executeEpilogue, executeExceptionEpilogue, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeQueryPrologue, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getActualSql, getConnection, getFetchDirection, getFetchSize, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResults, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getServerInfo, getSqlType, getSqlType, getUpdateCount, getWarnings, getWhereEndPos, isAddRowid, isClosed, isCloseOnCompletion, isCursorResultSet, isDml, isInternal, isPoolable, isSimpleIdentifier, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setInternal, setLargeMaxRows, setLocalInfileInputStream, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, setTimerTask, skipMoreResults, testExecute, unwrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcancel, clearWarnings, closeOnCompletion, execute, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, 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 boolean isObFunction
protected Map<Integer,ParameterHolder> currentParameterHolder
protected List<ParameterHolder[]> parametersList
protected ServerPrepareResult serverPrepareResult
public JDBC4ServerPreparedStatement(boolean isObFunction,
OceanBaseConnection connection,
String sql,
int resultSetScrollType,
int resultSetConcurrency,
int autoGeneratedKeys,
ExceptionFactory exceptionFactory)
throws SQLException
connection - current connectionsql - Sql String to prepareresultSetScrollType - one of the following ResultSet constants:
ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVEresultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY
or ResultSet.CONCUR_UPDATABLEautoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; one
of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYSexceptionFactory - Exception factorySQLException - exceptionpublic JDBC4ServerPreparedStatement clone(OceanBaseConnection connection) throws CloneNotSupportedException
clone 在类中 BasePrepareStatementconnection - connectionCloneNotSupportedException - if any error occur.public void setParameter(int parameterIndex,
ParameterHolder holder)
throws SQLException
setParameter 在类中 BasePrepareStatementSQLExceptionpublic void registerReturnParameter(int parameterIndex,
int externalType)
throws SQLException
SQLExceptionpublic void registerReturnParameter(int parameterIndex,
int externalType,
int maximumSize)
throws SQLException
SQLExceptionpublic void registerReturnParameter(int parameterIndex,
int externalType,
String internalTypeName)
throws SQLException
SQLExceptionpublic void registerReturnAutoGeneratedKey(AutoGeneratedKey autoGeneratedKey) throws SQLException
SQLExceptionpublic ParameterMetaData getParameterMetaData() throws SQLException
BasePrepareStatementPreparedStatement object's
parameters.getParameterMetaData 在接口中 PreparedStatementgetParameterMetaData 在类中 BasePrepareStatementParameterMetaData 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
getMetaData 在接口中 PreparedStatementSQLExceptionpublic ParameterHolder[] getParameters()
getParameters 在类中 BasePrepareStatementpublic void setParameters(ParameterHolder[] paramArray)
setParameters 在类中 BasePrepareStatementpublic void clearParameters()
throws SQLException
clearParameters 在接口中 PreparedStatementSQLExceptionprotected void validParameters()
throws SQLException
SQLExceptionpublic void addBatch()
throws SQLException
addBatch 在接口中 PreparedStatementSQLExceptionpublic void addBatch(String sql) throws SQLException
OceanBaseStatementStatement
object. The send in this list can be executed as a batch by calling the method
executeBatch.addBatch 在接口中 StatementaddBatch 在类中 OceanBaseStatementsql - typically this is a SQL INSERT or UPDATE statementSQLException - if a database access error occurs, this method is called on a closed
Statement or the driver does not support batch updatesOceanBaseStatement.executeBatch(),
DatabaseMetaData.supportsBatchUpdates()public void clearBatch()
OceanBaseStatementStatement object's current list of SQL send.public int[] executeBatch()
throws SQLException
int elements of the array that is returned
are ordered to correspond to the send 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 send 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 send in the
batch. However, the driver's behavior must be consistent with a particular DBMS, either
always continuing to process send or never continuing to process send. If the driver
continues processing after a failure, the array returned by the method
BatchUpdateException.getUpdateCounts will contain as many elements as there are
send 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 send after a command fails
The possible implementations and return values have been modified in the Java 2 SDK,
Standard Edition, version 1.3 to accommodate the option of continuing to proccess send in a
batch update after a BatchUpdateException object has been thrown.
executeBatch 在接口中 StatementexecuteBatch 在类中 OceanBaseStatementSQLException - 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 send sent to
the database fails to execute properly or attempts to return a result set.addBatch(),
DatabaseMetaData.supportsBatchUpdates()public int[] executeBatchQuerys()
throws SQLException
SQLExceptionpublic long[] executeLargeBatch()
throws SQLException
executeLargeBatch 在接口中 StatementexecuteLargeBatch 在类中 OceanBaseStatementSQLException - if a database error occur.public long[] executeLargeBatchQuerys()
throws SQLException
SQLExceptionpublic ResultSet executeQuery() throws SQLException
executeQuery 在接口中 PreparedStatementSQLExceptionpublic long executeLargeUpdate()
throws SQLException
executeLargeUpdate 在接口中 PreparedStatementexecuteLargeUpdate 在类中 BasePrepareStatementSQLExceptionpublic int executeUpdate()
throws SQLException
PreparedStatement object, which must be an SQL
Data Manipulation Language (DML) statement, such as INSERT, UPDATE or
DELETE; or an SQL statement that returns nothing, such as a DDL statement.
Result-set are permitted for historical reason, even if spec indicate to throw exception.executeUpdate 在接口中 PreparedStatementSQLException - if a database access error occurs; this method is called on a closed
PreparedStatementpublic boolean execute()
throws SQLException
execute 在接口中 PreparedStatementSQLExceptionprotected boolean executeInternal(int fetchSize)
throws SQLException
executeInternal 在类中 BasePrepareStatementSQLExceptionprotected boolean prepareExecuteInternal(int fetchSize)
throws SQLException
SQLExceptionpublic ColumnDefinition[] cursorFetch(int cursorId, int fetchSize) throws SQLException
SQLExceptionpublic void closeCursor(int cursorId)
throws SQLException
SQLExceptionpublic ColumnDefinition[] cursorFetchForOracle(int cursorId, int numRows, byte offsetType, int offset) throws SQLException
SQLExceptionpublic void close()
throws SQLException
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 在接口中 AutoCloseableclose 在接口中 Statementclose 在类中 OceanBaseStatementSQLException - if a database access error occurspublic void realClose(boolean calledExplicitly,
boolean closeOpenResults)
throws SQLException
realClose 在类中 OceanBaseStatementSQLExceptionpublic String toString()
public long getServerThreadId()
public ResultSet getReturnResultSet() throws SQLException
SQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
OceanBaseStatementStatement
object. If this Statement object did not generate any keys, an empty
ResultSet object is returned.
Note:If the columns which represent the auto-generated keys were not specified, the JDBC driver implementation will determine the columns which best represent the auto-generated keys.
getGeneratedKeys 在接口中 StatementgetGeneratedKeys 在类中 OceanBaseStatementResultSet object containing the auto-generated key(s) generated by the
execution of this Statement objectSQLException - if a database access error occurs or this method is called on a closed
StatementCopyright © 2024 oceanbase.com. All rights reserved.