public class StatementWrapper extends SimpleWrapper<PreparedStatement> implements PreparedStatement
raw| 构造器和说明 |
|---|
StatementWrapper(PreparedStatement raw)
构造
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBatch() |
void |
addBatch(String sql) |
void |
cancel() |
void |
clearBatch() |
void |
clearParameters() |
void |
clearWarnings() |
void |
close() |
void |
closeOnCompletion() |
boolean |
execute() |
boolean |
execute(String sql) |
boolean |
execute(String sql,
int autoGeneratedKeys) |
boolean |
execute(String sql,
int[] columnIndexes) |
boolean |
execute(String sql,
String[] columnNames) |
int[] |
executeBatch() |
ResultSet |
executeQuery() |
ResultSet |
executeQuery(String sql) |
int |
executeUpdate() |
int |
executeUpdate(String sql) |
int |
executeUpdate(String sql,
int autoGeneratedKeys) |
int |
executeUpdate(String sql,
int[] columnIndexes) |
int |
executeUpdate(String sql,
String[] columnNames) |
StatementWrapper |
fillArrayParam(Object... params)
填充数组类型的SQL的参数。
|
StatementWrapper |
fillParams(Iterable<?> params)
填充SQL的参数。
|
StatementWrapper |
fillParams(Iterable<?> params,
Map<Integer,Integer> nullTypeCache)
填充SQL的参数。
|
Connection |
getConnection() |
int |
getFetchDirection() |
int |
getFetchSize() |
ResultSet |
getGeneratedKeys() |
int |
getMaxFieldSize() |
int |
getMaxRows() |
ResultSetMetaData |
getMetaData() |
boolean |
getMoreResults() |
boolean |
getMoreResults(int current) |
ParameterMetaData |
getParameterMetaData() |
int |
getQueryTimeout() |
ResultSet |
getResultSet() |
int |
getResultSetConcurrency() |
int |
getResultSetHoldability() |
int |
getResultSetType() |
int |
getTypeOfNull(int paramIndex)
获取null字段对应位置的数据类型
有些数据库对于null字段必须指定类型,否则会插入报错,此方法用于获取其类型,如果获取失败,使用默认的 Types.VARCHAR |
int |
getUpdateCount() |
SQLWarning |
getWarnings() |
boolean |
isClosed() |
boolean |
isCloseOnCompletion() |
boolean |
isPoolable() |
boolean |
isWrapperFor(Class<?> iface) |
static StatementWrapper |
of(PreparedStatement raw)
构建StatementWrapper
|
void |
setArray(int parameterIndex,
Array x) |
void |
setAsciiStream(int parameterIndex,
InputStream x) |
void |
setAsciiStream(int parameterIndex,
InputStream x,
int length) |
void |
setAsciiStream(int parameterIndex,
InputStream x,
long length) |
void |
setBigDecimal(int parameterIndex,
BigDecimal x) |
void |
setBinaryStream(int parameterIndex,
InputStream x) |
void |
setBinaryStream(int parameterIndex,
InputStream x,
int length) |
void |
setBinaryStream(int parameterIndex,
InputStream x,
long length) |
void |
setBlob(int parameterIndex,
Blob x) |
void |
setBlob(int parameterIndex,
InputStream inputStream) |
void |
setBlob(int parameterIndex,
InputStream inputStream,
long length) |
void |
setBoolean(int parameterIndex,
boolean x) |
void |
setByte(int parameterIndex,
byte x) |
void |
setBytes(int parameterIndex,
byte[] x) |
void |
setCharacterStream(int parameterIndex,
Reader reader) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
int length) |
void |
setCharacterStream(int parameterIndex,
Reader reader,
long length) |
void |
setClob(int parameterIndex,
Clob x) |
void |
setClob(int parameterIndex,
Reader reader) |
void |
setClob(int parameterIndex,
Reader reader,
long length) |
void |
setCursorName(String name) |
void |
setDate(int parameterIndex,
Date x) |
void |
setDate(int parameterIndex,
Date x,
Calendar cal) |
void |
setDouble(int parameterIndex,
double x) |
void |
setEscapeProcessing(boolean enable) |
void |
setFetchDirection(int direction) |
void |
setFetchSize(int rows) |
void |
setFloat(int parameterIndex,
float x) |
void |
setInt(int parameterIndex,
int x) |
void |
setLong(int parameterIndex,
long x) |
void |
setMaxFieldSize(int max) |
void |
setMaxRows(int max) |
void |
setNCharacterStream(int parameterIndex,
Reader value) |
void |
setNCharacterStream(int parameterIndex,
Reader value,
long length) |
void |
setNClob(int parameterIndex,
NClob value) |
void |
setNClob(int parameterIndex,
Reader reader) |
void |
setNClob(int parameterIndex,
Reader reader,
long length) |
void |
setNString(int parameterIndex,
String value) |
void |
setNull(int parameterIndex,
int sqlType) |
void |
setNull(int parameterIndex,
int sqlType,
String typeName) |
void |
setObject(int parameterIndex,
Object x) |
void |
setObject(int parameterIndex,
Object x,
int targetSqlType) |
void |
setObject(int parameterIndex,
Object x,
int targetSqlType,
int scaleOrLength) |
void |
setParam(int paramIndex,
Object param)
为
PreparedStatement 设置单个参数 |
void |
setPoolable(boolean poolable) |
void |
setQueryTimeout(int seconds) |
void |
setRef(int parameterIndex,
Ref x) |
void |
setRowId(int parameterIndex,
RowId x) |
void |
setShort(int parameterIndex,
short x) |
void |
setSQLXML(int parameterIndex,
SQLXML xmlObject) |
void |
setString(int parameterIndex,
String x) |
void |
setTime(int parameterIndex,
Time x) |
void |
setTime(int parameterIndex,
Time x,
Calendar cal) |
void |
setTimestamp(int parameterIndex,
Timestamp x) |
void |
setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal) |
void |
setUnicodeStream(int parameterIndex,
InputStream x,
int length)
已过时。
|
void |
setURL(int parameterIndex,
URL x) |
<T> T |
unwrap(Class<T> iface) |
getRawclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecuteLargeUpdate, setObject, setObjectpublic StatementWrapper(PreparedStatement raw)
raw - PreparedStatementpublic static StatementWrapper of(PreparedStatement raw)
raw - PreparedStatementpublic ResultSet executeQuery(String sql) throws SQLException
executeQuery 在接口中 StatementSQLExceptionpublic int executeUpdate(String sql) throws SQLException
executeUpdate 在接口中 StatementSQLExceptionpublic void close()
throws SQLException
close 在接口中 AutoCloseableclose 在接口中 StatementSQLExceptionpublic int getMaxFieldSize()
throws SQLException
getMaxFieldSize 在接口中 StatementSQLExceptionpublic void setMaxFieldSize(int max)
throws SQLException
setMaxFieldSize 在接口中 StatementSQLExceptionpublic int getMaxRows()
throws SQLException
getMaxRows 在接口中 StatementSQLExceptionpublic void setMaxRows(int max)
throws SQLException
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
setCursorName 在接口中 StatementSQLExceptionpublic boolean execute(String sql) throws SQLException
execute 在接口中 StatementSQLExceptionpublic ResultSet getResultSet() throws SQLException
getResultSet 在接口中 StatementSQLExceptionpublic int getUpdateCount()
throws SQLException
getUpdateCount 在接口中 StatementSQLExceptionpublic boolean getMoreResults()
throws SQLException
getMoreResults 在接口中 StatementSQLExceptionpublic void setFetchDirection(int direction)
throws SQLException
setFetchDirection 在接口中 StatementSQLExceptionpublic int getFetchDirection()
throws SQLException
getFetchDirection 在接口中 StatementSQLExceptionpublic void setFetchSize(int rows)
throws SQLException
setFetchSize 在接口中 StatementSQLExceptionpublic int getFetchSize()
throws SQLException
getFetchSize 在接口中 StatementSQLExceptionpublic int getResultSetConcurrency()
throws SQLException
getResultSetConcurrency 在接口中 StatementSQLExceptionpublic int getResultSetType()
throws SQLException
getResultSetType 在接口中 StatementSQLExceptionpublic void addBatch(String sql) throws SQLException
addBatch 在接口中 StatementSQLExceptionpublic void clearBatch()
throws SQLException
clearBatch 在接口中 StatementSQLExceptionpublic int[] executeBatch()
throws SQLException
executeBatch 在接口中 StatementSQLExceptionpublic Connection getConnection() throws SQLException
getConnection 在接口中 StatementSQLExceptionpublic boolean getMoreResults(int current)
throws SQLException
getMoreResults 在接口中 StatementSQLExceptionpublic ResultSet getGeneratedKeys() throws SQLException
getGeneratedKeys 在接口中 StatementSQLExceptionpublic int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
executeUpdate 在接口中 StatementSQLExceptionpublic int executeUpdate(String sql, int[] columnIndexes) throws SQLException
executeUpdate 在接口中 StatementSQLExceptionpublic int executeUpdate(String sql, String[] columnNames) throws SQLException
executeUpdate 在接口中 StatementSQLExceptionpublic boolean execute(String sql, int autoGeneratedKeys) throws SQLException
execute 在接口中 StatementSQLExceptionpublic boolean execute(String sql, int[] columnIndexes) throws SQLException
execute 在接口中 StatementSQLExceptionpublic boolean execute(String sql, String[] columnNames) throws SQLException
execute 在接口中 StatementSQLExceptionpublic int getResultSetHoldability()
throws SQLException
getResultSetHoldability 在接口中 StatementSQLExceptionpublic boolean isClosed()
throws SQLException
isClosed 在接口中 StatementSQLExceptionpublic void setPoolable(boolean poolable)
throws SQLException
setPoolable 在接口中 StatementSQLExceptionpublic boolean isPoolable()
throws SQLException
isPoolable 在接口中 StatementSQLExceptionpublic void closeOnCompletion()
throws SQLException
closeOnCompletion 在接口中 StatementSQLExceptionpublic boolean isCloseOnCompletion()
throws SQLException
isCloseOnCompletion 在接口中 StatementSQLExceptionpublic <T> T unwrap(Class<T> iface) throws SQLException
SQLExceptionpublic boolean isWrapperFor(Class<?> iface) throws SQLException
SQLExceptionpublic ResultSet executeQuery() throws SQLException
executeQuery 在接口中 PreparedStatementSQLExceptionpublic int executeUpdate()
throws SQLException
executeUpdate 在接口中 PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int sqlType)
throws SQLException
setNull 在接口中 PreparedStatementSQLExceptionpublic void setBoolean(int parameterIndex,
boolean x)
throws SQLException
setBoolean 在接口中 PreparedStatementSQLExceptionpublic void setByte(int parameterIndex,
byte x)
throws SQLException
setByte 在接口中 PreparedStatementSQLExceptionpublic void setShort(int parameterIndex,
short x)
throws SQLException
setShort 在接口中 PreparedStatementSQLExceptionpublic void setInt(int parameterIndex,
int x)
throws SQLException
setInt 在接口中 PreparedStatementSQLExceptionpublic void setLong(int parameterIndex,
long x)
throws SQLException
setLong 在接口中 PreparedStatementSQLExceptionpublic void setFloat(int parameterIndex,
float x)
throws SQLException
setFloat 在接口中 PreparedStatementSQLExceptionpublic void setDouble(int parameterIndex,
double x)
throws SQLException
setDouble 在接口中 PreparedStatementSQLExceptionpublic void setBigDecimal(int parameterIndex,
BigDecimal x)
throws SQLException
setBigDecimal 在接口中 PreparedStatementSQLExceptionpublic void setString(int parameterIndex,
String x)
throws SQLException
setString 在接口中 PreparedStatementSQLExceptionpublic void setBytes(int parameterIndex,
byte[] x)
throws SQLException
setBytes 在接口中 PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date x)
throws SQLException
setDate 在接口中 PreparedStatementSQLExceptionpublic void setTime(int parameterIndex,
Time x)
throws SQLException
setTime 在接口中 PreparedStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp x)
throws SQLException
setTimestamp 在接口中 PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setAsciiStream 在接口中 PreparedStatementSQLException@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException
setUnicodeStream 在接口中 PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x,
int length)
throws SQLException
setBinaryStream 在接口中 PreparedStatementSQLExceptionpublic void clearParameters()
throws SQLException
clearParameters 在接口中 PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object x,
int targetSqlType)
throws SQLException
setObject 在接口中 PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object x)
throws SQLException
setObject 在接口中 PreparedStatementSQLExceptionpublic boolean execute()
throws SQLException
execute 在接口中 PreparedStatementSQLExceptionpublic void addBatch()
throws SQLException
addBatch 在接口中 PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
int length)
throws SQLException
setCharacterStream 在接口中 PreparedStatementSQLExceptionpublic void setRef(int parameterIndex,
Ref x)
throws SQLException
setRef 在接口中 PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
Blob x)
throws SQLException
setBlob 在接口中 PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Clob x)
throws SQLException
setClob 在接口中 PreparedStatementSQLExceptionpublic void setArray(int parameterIndex,
Array x)
throws SQLException
setArray 在接口中 PreparedStatementSQLExceptionpublic ResultSetMetaData getMetaData() throws SQLException
getMetaData 在接口中 PreparedStatementSQLExceptionpublic void setDate(int parameterIndex,
Date x,
Calendar cal)
throws SQLException
setDate 在接口中 PreparedStatementSQLExceptionpublic void setTime(int parameterIndex,
Time x,
Calendar cal)
throws SQLException
setTime 在接口中 PreparedStatementSQLExceptionpublic void setTimestamp(int parameterIndex,
Timestamp x,
Calendar cal)
throws SQLException
setTimestamp 在接口中 PreparedStatementSQLExceptionpublic void setNull(int parameterIndex,
int sqlType,
String typeName)
throws SQLException
setNull 在接口中 PreparedStatementSQLExceptionpublic void setURL(int parameterIndex,
URL x)
throws SQLException
setURL 在接口中 PreparedStatementSQLExceptionpublic ParameterMetaData getParameterMetaData() throws SQLException
getParameterMetaData 在接口中 PreparedStatementSQLExceptionpublic void setRowId(int parameterIndex,
RowId x)
throws SQLException
setRowId 在接口中 PreparedStatementSQLExceptionpublic void setNString(int parameterIndex,
String value)
throws SQLException
setNString 在接口中 PreparedStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value,
long length)
throws SQLException
setNCharacterStream 在接口中 PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
NClob value)
throws SQLException
setNClob 在接口中 PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setClob 在接口中 PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream,
long length)
throws SQLException
setBlob 在接口中 PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader,
long length)
throws SQLException
setNClob 在接口中 PreparedStatementSQLExceptionpublic void setSQLXML(int parameterIndex,
SQLXML xmlObject)
throws SQLException
setSQLXML 在接口中 PreparedStatementSQLExceptionpublic void setObject(int parameterIndex,
Object x,
int targetSqlType,
int scaleOrLength)
throws SQLException
setObject 在接口中 PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setAsciiStream 在接口中 PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x,
long length)
throws SQLException
setBinaryStream 在接口中 PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader,
long length)
throws SQLException
setCharacterStream 在接口中 PreparedStatementSQLExceptionpublic void setAsciiStream(int parameterIndex,
InputStream x)
throws SQLException
setAsciiStream 在接口中 PreparedStatementSQLExceptionpublic void setBinaryStream(int parameterIndex,
InputStream x)
throws SQLException
setBinaryStream 在接口中 PreparedStatementSQLExceptionpublic void setCharacterStream(int parameterIndex,
Reader reader)
throws SQLException
setCharacterStream 在接口中 PreparedStatementSQLExceptionpublic void setNCharacterStream(int parameterIndex,
Reader value)
throws SQLException
setNCharacterStream 在接口中 PreparedStatementSQLExceptionpublic void setClob(int parameterIndex,
Reader reader)
throws SQLException
setClob 在接口中 PreparedStatementSQLExceptionpublic void setBlob(int parameterIndex,
InputStream inputStream)
throws SQLException
setBlob 在接口中 PreparedStatementSQLExceptionpublic void setNClob(int parameterIndex,
Reader reader)
throws SQLException
setNClob 在接口中 PreparedStatementSQLExceptionpublic StatementWrapper fillArrayParam(Object... params) throws SQLException
params - SQL参数SQLException - SQL执行异常public StatementWrapper fillParams(Iterable<?> params) throws SQLException
params - SQL参数SQLException - SQL执行异常public StatementWrapper fillParams(Iterable<?> params, Map<Integer,Integer> nullTypeCache) throws SQLException
params - SQL参数nullTypeCache - null参数的类型缓存,避免循环中重复获取类型SQLException - SQL执行异常public void setParam(int paramIndex,
Object param)
throws SQLException
PreparedStatement 设置单个参数paramIndex - 参数位置,从1开始param - 参数SQLException - SQL异常public int getTypeOfNull(int paramIndex)
Types.VARCHARparamIndex - 参数位置,第一位从1开始Types.VARCHARCopyright © 2024. All rights reserved.