public class Statement extends Object implements Statement
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
batchCount
应用执行批处理条数
|
protected int |
batchMajorVersion
实现批处理的服务器主版本号
|
protected int |
batchMinorVersion
实现批处理的服务器子版本号
|
protected boolean |
blobColParam
预处理语句是否包含大对象(LOB和Binary)类型字段(批量处理时,如果有大对象字段,则不走真批)
|
protected HashMap<String,Integer> |
colMap
存放CallableStatement预处理存储过程的参数名Map
|
protected Connection |
connection
创建该 Statement 对象的 Connection 对象
|
protected String |
conObjName
当前连接对象名,用作区分各个连接的st对象
|
protected long |
curId |
protected int |
cursorFirstCount
查询使用游标方式,定义游标时,首次从服务器读取数据条数
|
protected boolean |
cursorFirstOver |
protected int |
fetchSize
此 Statement 生成的 ResultSet 对象当调用rs.next时,ResultSet会一次性从服务器上取得多少行数据回来,游标方式起作用
|
protected int |
generateKey
Statement中是否要返回自动生成键(用常量来区别,1:表示要返回自动生成键,-1:表示不返回自动生成键)
|
protected boolean |
isBatchSql
用于标记预处理SQL语句是否为可以批量处理的SQL语句(insert、update、delete可批量处理)
|
protected boolean |
isBuildingMap
当对象是CallableStatement时,是否建立了参数名和参数位置对应的映射
|
protected boolean |
isCallable
区别命令是否来至CallableStatement
|
protected boolean |
isCallProc
区别命令是否是执行存储过程
|
protected boolean |
isClosed
Statement对象是否已经关闭
|
protected boolean |
isExeBatch
是否是执行的批命令
|
protected boolean |
isFetchSql
该变量为true表示是服务器端游标,recv_mode=2。
|
protected boolean |
isFunction
为TRUE时,表示是执行存储函数。
|
protected boolean |
isOutP
SQL语句返回是否有输出型参数,为true则说明有输出型参数,在收到K后需要发送FETCH语句从服务器端取回输出参数值
|
protected boolean |
isPoolable
StatementPooling
|
protected boolean |
isPrepared
是否在服务器端预定义了语句
|
protected boolean |
isQuery
prepare()方法发送语句到服务器,根据服务器返回确定发送语句是否是查询语句.true表示是查询语句
|
protected boolean |
isReturnCount
是否为要返回行计数的SQL语句
|
protected int |
maxSize
此 Statement 生成的 ResultSet 对象可以包含的最大行数限制
|
protected StringBuffer |
paramAllStrs
存储过程?
|
protected byte[] |
paramBytes
实参打包后数据
|
protected HashMap<Integer,String> |
paramConstMap
存放CallableStatement预处理存储过程的常量参数Map<参数位置,常量值>>
|
protected int |
paramCount |
protected ParamList |
paramList
save the param of the SQL
|
protected ParamList |
paramLobs |
protected boolean |
paramNameFunc
带参数名的函数调用语句标记。
|
protected int |
paramNameIndex
存储过程按名绑定时,绑定参数的顺序值
|
protected Map |
paramNameToIndex
完整列名到索引的映射对象
|
protected int |
queryTime
Statement 对象执行的秒数
|
protected int |
resultDirection
此 Statement 对象创建的 ResultSet 对象处理行的方向,FETCH_REVERSE,FETCH_FORWARD,FETCH_UNKNOWN
|
protected String |
schemaName |
protected int |
serverBatchCount
服务器返回批处理执行条数
|
protected boolean |
sqlQuery
SQL语句类型是否为查询语句,当FIRSTRESULT方法中收到A时,该标记为TRUE
|
protected long |
stId |
protected boolean |
stmIsOver
最新一次的访问结果是否全部接受完毕。
|
protected SQLWarning |
stmWarning
该变量用于存放警告,消息
|
protected String |
tableName
SQL 语句中操作表的表名
|
protected int |
updateCount
执行更新操作时返回的实际更新行数,初始为-1;多结果集接收,首先从服务器接收影响条数,值为影响条数;如果不是首先接收,则值为-2
|
| 构造器和说明 |
|---|
Statement()
构造方法
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch(String sql)
Adds the given SQL command to the current list of commmands for this
Statement object. |
protected double |
byteToDouble(ByteBuffer pb,
byte[] doubleData)
网络序的byte[] 转double
|
protected float |
byteToFloat(ByteBuffer pb,
byte[] floatData)
网络序的byte[] 转float
|
protected int |
byteToInt(ByteBuffer pb,
byte[] intData)
网络序的byte[] 转int
|
protected long |
byteToLong(ByteBuffer pb,
byte[] longData)
网络序的byte[] 转long
|
protected String |
byteToNumeric(byte[] numerData)
网络序的byte[] 转Numeric
|
protected short |
byteToShort(ByteBuffer pb,
byte[] shortData)
网络序的byte[] 转short
|
void |
cancel()
如果 DBMS 和驱动程序都支持中止 SQL 语句,则取消此 Statement 对象。
|
protected void |
checkBCountAndPCount(int bCount,
int pCount) |
protected boolean |
checkCallInParam() |
protected boolean |
checkCallOutParam() |
protected boolean |
checkCallOutParam(int i) |
protected void |
checkGeneratedKey(String sql,
int autoGeneratedKeys)
检查是否为可以返回的自增长值,并且分离表名,取的自增长列名
|
protected void |
checkSqlLen(String sql) |
protected void |
checkSQLNull(String sql)
判断执行语句为NULL时,应该抛异常
|
void |
clearBatch()
Empties this
Statement object's current list of
SQL commands. |
void |
clearWarnings()
清除在此 Statement 对象上报告的所有警告。
|
void |
close()
立即释放此 Statement 对象的数据库和 JDBC 资源,而不是等待该对象自动关闭时发生此操作。
|
void |
closeOnCompletion() |
protected void |
distillTbName(String sql)
用于提取TABLE名字,TABLE名字用于getGeneratedKey时查询自增长字段的当前值
|
boolean |
execute(String sql)
执行给定的 SQL 语句,该语句可能返回多个结果。
|
boolean |
execute(String sql,
boolean retrieveGeneratedKeys) |
boolean |
execute(String sql,
int autoGeneratedKeys)
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.
|
boolean |
execute(String sql,
int[] columnIndexes)
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.
|
boolean |
execute(String sql,
String[] columnNames)
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.
|
int[] |
executeBatch()
Submits a batch of commands to the database for execution and
if all commands execute successfully, returns an array of update counts.
|
ResultSet |
executeLob(String sql)
描述符取大对象数据方法
|
ResultSet |
executeQuery(String sql)
执行给定的 SQL 语句,该语句返回单个 ResultSet 对象
|
ResultSet |
executeQueryFetch(String sql,
int fetchSize,
RowData rd,
boolean isRturn)
isRturn为TRUE表示要求返回结果集,否则,都不要求返回结果集
|
void |
executeStream(byte[] streamBytes)
用来流式传输数据,参数有:一条数据的byte[]
|
void |
executeStream(Vector streamVector)
用来流式传输数据,参数有:多条记录的Vector
|
void |
executeStreamLoad(Vector streamVector)
LOAD TABLE sysdba.t1 RECORDS DELIMITED BY X'0a' FIELDS TERMINATED BY ',' PARALLEL 8,8;
|
int |
executeUpdate(String sql)
执行给定更新 SQL 语句
该语句可能为 INSERT、UPDATE 或 DELETE 语句;
或者不返回任何内容的 SQL 语句(如 SQL DDL 语句);
|
int |
executeUpdate(String sql,
int autoGeneratedKeys)
Executes the given SQL statement and signals the driver with the
given flag about whether the
auto-generated keys produced by this
Statement object
should be made available for retrieval. |
int |
executeUpdate(String sql,
int[] columnIndexes)
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.
|
int |
executeUpdate(String sql,
String[] columnNames)
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.
|
protected boolean |
executeWithNoCallCheck(String sql)
Description: 内部调用执行SQL语句
|
protected ResultSet |
firstResultSet() |
boolean |
flush()
将 IO的BUFFER中未发送数据强行发送到服务器
|
protected String |
getColumnName(String schemaNm,
String tableNm)
该方法用于找出指定表tableNm的自动生成键名
|
Connection |
getConnection()
Retrieves the
Connection object
that produced this Statement object. |
protected int |
getCursorFirstCount() |
protected int |
getErr_Code(String str) |
protected String |
getExecuteStr(String inSql)
处理存储过程函数调用的参数部分,返回完整的执行SQL命令
|
int |
getFetchDirection()
获取从数据库表获取行的方向,向前或者反向。
|
int |
getFetchSize()
Retrieves the number of result set rows that is the default
fetch size for
ResultSet objects
generated from this Statement object. |
ResultSet |
getGeneratedKeys()
Retrieves any auto-generated keys created as a result of executing this
Statement object. |
protected ResultSet |
getLobResultSet(String clobDesciptor,
long startIndex,
long clobLen)
获取描述符大对象的结果集合,以后要改成返回InputStream对象,不再构造成结果集返回
|
int |
getMaxFieldSize()
检索可以为此 Statement 对象所生成 ResultSet 对象中的字符和二进制列值返回的最大字节数。
|
int |
getMaxRows()
检索由此 Statement 对象生成的 ResultSet 对象可以包含的最大行数
如果超过了此限制,则安静地撤消多出的行。
|
boolean |
getMoreResults()
移动到此 Statement 对象的下一个结果,如果其为 ResultSet 对象,则返回 true,
并隐式关闭利用方法 getResultSet 获取的所有当前 ResultSet 对象。
|
boolean |
getMoreResults(int current) |
protected String |
getProcName(String sql)
Title: getProcName
接口方法:获取过程/函数对象名。
|
protected String[] |
getProcParamsName(String sql)
Title: getProcParamsName
接口方法:获取过程/函数参数名数组。
|
int |
getQueryTimeout()
检索驱动程序等待 Statement 对象执行的秒数。
|
ResultSet |
getResultSet()
获取当前结果集
|
int |
getResultSetConcurrency()
Retrieves the result set concurrency for
ResultSet objects
generated by this Statement object. |
int |
getResultSetHoldability()
Retrieves the result set holdability for
ResultSet objects
generated by this Statement object. |
int |
getResultSetType()
Retrieves the result set type for
ResultSet objects
generated by this Statement object. |
protected Hashtable<Integer,String> |
getRowid()
获取SQL语句插入或更新记录的ROWID
|
boolean |
getServerCursor()
获得是否是服务器端游标,在执行的SQL语句是单命令语句时有效
|
protected int |
getServerMajorVersion()
获取服务器主版本号
|
protected int |
getServerMinorVersion()
获取服务器子版本号
|
Vector |
getSqlsEffectCountVector()
该方法用于得到存放SQL语句影响数据库记录条数(或者查询条数),和信息的Vector
|
int |
getUpdateCount()
获取更新的行数
|
SQLWarning |
getWarnings()
检索此 Statement 对象上的调用报告的第一个警告。
|
protected void |
initExecuteEnviorment(String checkSql,
boolean cleanWarnnings) |
protected byte[] |
intToByte(int intData) |
boolean |
isClosed()
该方法返回值为true时,该Statement关闭
|
boolean |
isCloseOnCompletion() |
protected boolean |
isFetchSql()
True 表示要发FETCH语句
|
int |
isLimitParamSql(String sql) |
boolean |
isPoolable() |
protected boolean |
isReturnValues(String sql)
检测是否是有返回信息的SQL,true为有返回。
|
boolean |
isStmIsOver() |
boolean |
isWrapperFor(Class<?> iface) |
protected byte[] |
longToByte(long longData) |
ResultSet |
manificateRs(Connection connection,
String catalog,
Field[] field,
ArrayList<byte[][]> dataList,
Statement stm)
手动构造ResultSet对象
|
void |
reSizeBuffer() |
protected void |
resumeRowid()
每次发送命令前,将存放ROWID的Hashtable清空
|
protected void |
resumeSendType()
将isOver和sqlQuery标记复位。
|
ResultSet |
rsRowData(String fetchSql,
int fetchSize,
RowData rad,
boolean isReturn) |
long |
sendTaskNum(long taskNum)
发送,接受任务号
|
protected boolean |
serverSupportBatch() |
void |
setCursorName(String name)
将 SQL 指针名称设置为给定的 String,后续 Statement 对象的 execute 方法将使用此字符串。
|
void |
setEscapeProcessing(boolean enable)
将转义处理设置为开或关
---暂时考虑不实现
|
void |
setFetchDirection(int direct)
Gives the driver a hint as to the direction in which
rows will be processed in
ResultSet
objects created using this Statement object. |
void |
setFetchSize(int rows)
Gives the JDBC driver a hint as to the number of rows that should
be fetched from the database when more rows are needed.
|
protected void |
setFetchSql(boolean isFetchSql)
设置是否向服务器发送FETCH命令,true发送FETCH命令
|
protected void |
setIndexMaping(String param,
int listcount) |
void |
setMaxFieldSize(int max)
设置将字符或二进制值存储到给定字节数中 ResultSet 列中的最大字节数限制。
|
void |
setMaxRows(int max)
将任何 ResultSet 对象都可以包含的最大行数限制设置为给定数。
|
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds)
将驱动程序等待 Statement 对象执行的秒数设置为给定秒数。
|
void |
setRecv_mode(int mode)
该方法用于设置本连接上的接收方式,0:本地全接收方式,1:只能向前读取的大数据量网络缓存接收方式,2:服务器端游标方式
|
void |
setResultsetFirstSize(int resultsetSize)
设置启动异步接收条数
|
void |
setServerCursor(boolean serverCursor)
开起服务器端游标,执行的SQL语句是单命令语句时开启有效
|
protected void |
setSQLExecuteMG(Object mesg_info,
char state)
客户端取得执行命令返回信息,需要将这些信息存入一个Vector中
|
void |
setStmIsOver(boolean stmIsOver) |
void |
setStmWarning(String warnings) |
String |
toString() |
<T> T |
unwrap(Class<T> iface) |
protected Connection connection
protected String conObjName
protected boolean isClosed
protected boolean isOutP
protected boolean paramNameFunc
protected boolean isPoolable
protected boolean isBatchSql
protected int resultDirection
protected int updateCount
protected volatile boolean stmIsOver
protected boolean blobColParam
protected long stId
protected long curId
protected HashMap<Integer,String> paramConstMap
protected byte[] paramBytes
protected int paramCount
protected ParamList paramList
protected ParamList paramLobs
protected boolean isPrepared
protected boolean isFunction
protected boolean isExeBatch
protected int serverBatchCount
protected int batchCount
protected boolean isReturnCount
protected int generateKey
protected String tableName
protected String schemaName
protected boolean isCallable
protected boolean isCallProc
protected boolean isBuildingMap
protected Map paramNameToIndex
protected int queryTime
protected int fetchSize
protected int cursorFirstCount
protected boolean cursorFirstOver
protected int maxSize
protected SQLWarning stmWarning
protected boolean sqlQuery
protected boolean isQuery
protected boolean isFetchSql
protected int batchMajorVersion
protected int batchMinorVersion
protected StringBuffer paramAllStrs
protected int paramNameIndex
protected void setIndexMaping(String param, int listcount) throws SQLException
SQLExceptionprotected ResultSet firstResultSet() throws SQLException
SQLExceptionpublic ResultSet executeLob(String sql) throws SQLException
SQLExceptionpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery 在接口中 StatementSQLExceptionpublic ResultSet executeQueryFetch(String sql, int fetchSize, RowData rd, boolean isRturn) throws SQLException
SQLExceptionpublic ResultSet rsRowData(String fetchSql, int fetchSize, RowData rad, boolean isReturn) throws SQLException
SQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate 在接口中 StatementSQLExceptionpublic void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 StatementSQLExceptionpublic int getMaxFieldSize()
throws SQLException
---暂时无限制 存储字符和二进制值的列的当前列大小限制;0 表示没有任何限制
getMaxFieldSize 在接口中 StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
---暂时考虑不实现
setMaxFieldSize 在接口中 StatementSQLExceptionpublic int getMaxRows()
throws SQLException
如果超过了此限制,则安静地撤消多出的行。
getMaxRows 在接口中 StatementSQLExceptionpublic void setMaxRows(int max)
throws SQLException
如果超过了该限制,则安静地撤消多出的行。
参数: max - 新的最大行数限制;零表示没有任何限制
setMaxRows 在接口中 StatementSQLExceptionpublic void setEscapeProcessing(boolean enable)
throws SQLException
---暂时考虑不实现
setEscapeProcessing 在接口中 StatementSQLExceptionpublic int getQueryTimeout()
throws SQLException
---暂时考虑不实现
getQueryTimeout 在接口中 StatementSQLExceptionpublic void setQueryTimeout(int seconds)
throws SQLException
---暂时考虑不实现
setQueryTimeout 在接口中 StatementSQLExceptionpublic void cancel()
throws SQLException
---暂时考虑不实现
cancel 在接口中 StatementSQLExceptionpublic SQLWarning getWarnings() throws SQLException
---暂时考虑不实现
getWarnings 在接口中 StatementSQLExceptionpublic void clearWarnings()
throws SQLException
---暂时考虑不实现
clearWarnings 在接口中 StatementSQLExceptionpublic void setCursorName(String name) throws SQLException
注:按照定义,位置更新和删除必须由生成的用于放置的 ResultSet 对象之外的某个 Statement 对象来执行。 此外,在连接中指针名称还必须是惟一的。
setCursorName 在接口中 StatementSQLExceptionpublic void executeStream(byte[] streamBytes)
throws SQLException
SQLExceptionpublic void executeStream(Vector streamVector) throws SQLException
SQLExceptionpublic void executeStreamLoad(Vector streamVector) throws SQLException
SQLExceptionpublic void reSizeBuffer()
public boolean flush()
throws SQLException,
IOException
public boolean execute(String sql) throws SQLException
execute 方法执行 SQL 语句并指示第一个结果的形式。 然后,必须使用方法 getResultSet 或 getUpdateCount 来检索结果,使用 getMoreResults 来移动后续结果。
如果第一个结果为 ResultSet 对象,则返回 true;如果其为更新计数或者不存在任何结果,则返回 false
execute 在接口中 StatementSQLExceptionpublic boolean execute(String sql, boolean retrieveGeneratedKeys) throws SQLException
SQLExceptionprotected boolean executeWithNoCallCheck(String sql) throws SQLException
Description: 内部调用执行SQL语句
SQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet 在接口中 StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount 在接口中 StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults 在接口中 StatementSQLExceptionpublic void setFetchDirection(int direct)
throws SQLException
ResultSet
objects created using this Statement object. The
default value is ResultSet.FETCH_FORWARD.
Note that this method sets the default fetch direction for
result sets generated by this Statement object.
Each result set has its own methods for getting and setting
its own fetch direction.
setFetchDirection 在接口中 Statementdirect - the initial direction for processing rowsSQLException - if a database access error occurs
or the given direction
is not one of ResultSet.FETCH_FORWARD,
ResultSet.FETCH_REVERSE, or ResultSet.FETCH_UNKNOWNgetFetchDirection()public int getFetchDirection()
throws SQLException
getFetchDirection 在接口中 StatementSQLExceptionpublic void setFetchSize(int rows)
throws SQLException
setFetchSize 在接口中 Statementrows - the number of rows to fetchSQLException - if a database access error occurs, or the
condition 0 <= rows <= this.getMaxRows()
is not satisfied.getFetchSize()public int getFetchSize()
throws SQLException
ResultSet objects
generated from this Statement object.
If this Statement object has not set
a fetch size by calling the method setFetchSize,
the return value is implementation-specific.getFetchSize 在接口中 StatementStatement objectSQLException - if a database access error occurssetFetchSize(int)public int getResultSetConcurrency()
throws SQLException
ResultSet objects
generated by this Statement object.getResultSetConcurrency 在接口中 StatementResultSet.CONCUR_READ_ONLY or
ResultSet.CONCUR_UPDATABLESQLException - if a database access error occurspublic int getResultSetType()
throws SQLException
ResultSet objects
generated by this Statement object.getResultSetType 在接口中 StatementResultSet.TYPE_FORWARD_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE, or
ResultSet.TYPE_SCROLL_SENSITIVESQLException - if a database access error occurspublic void addBatch(String sql) throws SQLException
Statement object. The commands in this list can be
executed as a batch by calling the method executeBatch.
NOTE: This method is optional.
addBatch 在接口中 Statementsql - typically this is a static SQL INSERT or
UPDATE statementSQLException - if a database access error occurs, or the
driver does not support batch updatesexecuteBatch()public void clearBatch()
throws SQLException
Statement object's current list of
SQL commands.
NOTE: This method is optional.
clearBatch 在接口中 StatementSQLException - if a database access error occurs or the
driver does not support batch updatesaddBatch(java.lang.String)public int[] executeBatch()
throws SQLException
int elements of the array that is returned are ordered
to correspond to the commands 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 commands 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 commands in
the batch. However, the driver's behavior must be consistent with a
particular DBMS, either always continuing to process commands or never
continuing to process commands. If the driver continues processing
after a failure, the array returned by the method
BatchUpdateException.getUpdateCounts
will contain as many elements as there are commands 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 commands after a command fails
A driver is not required to implement this method.
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 commands in a batch
update after a BatchUpdateException obejct has been thrown.
executeBatch 在接口中 StatementSQLException - if a database access error occurs or the
driver does not support batch statements. Throws BatchUpdateException
(a subclass of SQLException) if one of the commands sent to the
database fails to execute properly or attempts to return a result set.public Connection getConnection() throws SQLException
Connection object
that produced this Statement object.getConnection 在接口中 StatementSQLException - if a database access error occurspublic boolean getMoreResults(int current)
throws SQLException
getMoreResults 在接口中 StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
Statement object. If this Statement object did
not generate any keys, an empty ResultSet
object is returned.getGeneratedKeys 在接口中 StatementResultSet object containing the auto-generated key(s)
generated by the execution of this Statement objectSQLException - if a database access error occurspublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
Statement object
should be made available for retrieval.executeUpdate 在接口中 Statementsql - must be an SQL INSERT, UPDATE or
DELETE statement or an SQL statement that
returns nothingautoGeneratedKeys - a flag indicating whether auto-generated keys
should be made available for retrieval;
one of the following constants:
Statement.RETURN_GENERATED_KEYS
Statement.NO_GENERATED_KEYSINSERT, UPDATE
or DELETE statements, or 0 for SQL
statements that return nothingSQLException - if a database access error occurs, the given
SQL statement returns a ResultSet object, or
the given constant is not one of those allowedpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
INSERT statement.executeUpdate 在接口中 Statementsql - an SQL INSERT, UPDATE or
DELETE statement or an SQL statement that returns nothing,
such as an SQL DDL statementcolumnIndexes - an array of column indexes indicating the columns
that should be returned from the inserted rowINSERT, UPDATE,
or DELETE statements, or 0 for SQL statements
that return nothingSQLException - if a database access error occurs, the SQL
statement returns a ResultSet object, or the
second argument supplied to this method is not an int array
whose elements are valid column indexespublic int executeUpdate(String sql, String[] columnNames) throws SQLException
INSERT statement.executeUpdate 在接口中 Statementsql - an SQL INSERT, UPDATE or
DELETE statement or an SQL statement that returns nothingcolumnNames - an array of the names of the columns that should be
returned from the inserted rowINSERT, UPDATE,
or DELETE statements, or 0 for SQL statements
that return nothingSQLException - if a database access error occurs, the SQL
statement returns a ResultSet object, or the
second argument supplied to this method is not a String array
whose elements are valid column namespublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
INSERT statement.
In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
execute 在接口中 Statementsql - any SQL statementautoGeneratedKeys - a constant indicating whether auto-generated
keys should be made available for retrieval using the method
getGeneratedKeys; one of the following constants:
Statement.RETURN_GENERATED_KEYS or
Statement.NO_GENERATED_KEYStrue if the first result is a ResultSet
object; false if it is an update count or there are
no resultsSQLException - if a database access error occurs or the second
parameter supplied to this method is not
Statement.RETURN_GENERATED_KEYS or
Statement.NO_GENERATED_KEYS.getResultSet(),
getUpdateCount(),
getMoreResults(),
getGeneratedKeys()public boolean execute(String sql, int[] columnIndexes) throws SQLException
INSERT statement.
Under some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
execute 在接口中 Statementsql - any SQL statementcolumnIndexes - an array of the indexes of the columns in the
inserted row that should be made available for retrieval by a
call to the method getGeneratedKeystrue if the first result is a ResultSet
object; false if it is an update count or there
are no resultsSQLException - if a database access error occurs or the
elements in the int array passed to this method
are not valid column indexesgetResultSet(),
getUpdateCount(),
getMoreResults()public boolean execute(String sql, String[] columnNames) throws SQLException
INSERT statement.
In some (uncommon) situations, a single SQL statement may return multiple result sets and/or update counts. Normally you can ignore this unless you are (1) executing a stored procedure that you know may return multiple results or (2) you are dynamically executing an unknown SQL string.
The execute method executes an SQL statement and indicates the
form of the first result. You must then use the methods
getResultSet or getUpdateCount
to retrieve the result, and getMoreResults to
move to any subsequent result(s).
execute 在接口中 Statementsql - any SQL statementcolumnNames - an array of the names of the columns in the inserted
row that should be made available for retrieval by a call to the
method getGeneratedKeystrue if the next result is a ResultSet
object; false if it is an update count or there
are no more resultsSQLException - if a database access error occurs or the
elements of the String array passed to this
method are not valid column namesgetResultSet(),
getUpdateCount(),
getMoreResults(),
getGeneratedKeys()public int getResultSetHoldability()
throws SQLException
ResultSet objects
generated by this Statement object.getResultSetHoldability 在接口中 StatementResultSet.HOLD_CURSORS_OVER_COMMIT or
ResultSet.CLOSE_CURSORS_AT_COMMITSQLException - if a database access error occurspublic boolean isClosed()
throws SQLException
isClosed 在接口中 StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable 在接口中 StatementSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion 在接口中 StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion 在接口中 StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable 在接口中 StatementSQLExceptionprotected int getErr_Code(String str)
protected void distillTbName(String sql)
protected boolean isReturnValues(String sql)
sql - protected String getColumnName(String schemaNm, String tableNm) throws SQLException
SQLExceptionpublic void setRecv_mode(int mode)
protected void checkSQLNull(String sql) throws SQLException
sql - SQLExceptionprotected void initExecuteEnviorment(String checkSql, boolean cleanWarnnings) throws SQLException
SQLExceptionpublic void setStmWarning(String warnings)
public long sendTaskNum(long taskNum)
throws SQLException
SQLExceptionprotected void resumeRowid()
protected void resumeSendType()
public void setResultsetFirstSize(int resultsetSize)
protected ResultSet getLobResultSet(String clobDesciptor, long startIndex, long clobLen) throws SQLException
SQLExceptionprotected void setSQLExecuteMG(Object mesg_info, char state)
public Vector getSqlsEffectCountVector()
public void setServerCursor(boolean serverCursor)
public boolean getServerCursor()
protected boolean isFetchSql()
protected void setFetchSql(boolean isFetchSql)
protected short byteToShort(ByteBuffer pb, byte[] shortData)
protected int byteToInt(ByteBuffer pb, byte[] intData)
protected byte[] intToByte(int intData)
protected byte[] longToByte(long longData)
protected long byteToLong(ByteBuffer pb, byte[] longData)
protected float byteToFloat(ByteBuffer pb, byte[] floatData)
protected double byteToDouble(ByteBuffer pb, byte[] doubleData)
protected String byteToNumeric(byte[] numerData)
protected void checkGeneratedKey(String sql, int autoGeneratedKeys) throws SQLException
SQLExceptionpublic boolean isStmIsOver()
public void setStmIsOver(boolean stmIsOver)
stmIsOver - the stmIsOver to setprotected int getServerMajorVersion()
throws SQLException
SQLExceptionprotected int getServerMinorVersion()
throws SQLException
SQLExceptionprotected boolean serverSupportBatch()
throws SQLException
SQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
isWrapperFor 在接口中 WrapperSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
unwrap 在接口中 WrapperSQLExceptionpublic int isLimitParamSql(String sql)
public ResultSet manificateRs(Connection connection, String catalog, Field[] field, ArrayList<byte[][]> dataList, Statement stm) throws SQLException
connection - catalog - field - dataList - SQLExceptionprotected int getCursorFirstCount()
protected String getProcName(String sql)
Title: getProcName
接口方法:获取过程/函数对象名。可选择使用驱动硬解析或虚谷Parser解析sql - SQLExceptionprotected String[] getProcParamsName(String sql)
Title: getProcParamsName
接口方法:获取过程/函数参数名数组。可选择使用驱动硬解析或虚谷Parser解析sql - protected boolean checkCallInParam()
protected boolean checkCallOutParam()
protected boolean checkCallOutParam(int i)
protected String getExecuteStr(String inSql)
protected void checkBCountAndPCount(int bCount,
int pCount)
throws SQLException
SQLExceptionprotected void checkSqlLen(String sql)
Copyright © 2025. All rights reserved.