Altibase.jdbc.driver

## Class AltibaseStatement

- java.lang.Object
- - Altibase.jdbc.driver.WrapperAdapter
  - - Altibase.jdbc.driver.AltibaseStatement

All Implemented Interfaces:
  java.lang.AutoCloseable, java.sql.Statement, java.sql.Wrapper

Direct Known Subclasses:
  AbstractPreparedStatement

    public class AltibaseStatement
    extends WrapperAdapter
    implements java.sql.Statement

### Nested Class Summary

Nested Classes
`protected class` `AltibaseStatement.ExecuteResultManager`

### Field Summary

Fields
`static int` `BYTES_PER_CHAR`
`protected static long[]` `EMPTY_LARGE_BATCH_RESULT`
`protected boolean` `mBatchSetBytesUseLob`
`protected AltibaseConnection` `mConnection`
`protected short` `mCurrentResultIndex`
`protected AltibaseResultSet` `mCurrentResultSet`
`protected boolean` `mEscapeProcessing`
`protected AltibaseStatement.ExecuteResultManager` `mExecuteResultMgr`
`protected CmExecutionResult` `mExecutionResult`
`protected CmFetchResult` `mFetchResult`
`protected int` `mFetchSize`
`protected boolean` `mForceClobBind`
`protected boolean` `mIsClosed`
`protected boolean` `mIsDeferred`
`protected int` `mMaxFieldSize`
`protected long` `mMaxRows`
`protected CmPrepareResult` `mPrepareResult`
`protected java.util.List<Column>` `mPrepareResultColumns`
`protected java.lang.String` `mQstr`
`protected java.util.List<java.sql.ResultSet>` `mResultSetList`
`protected boolean` `mResultSetReturned`
`protected boolean` `mReUseResultSet`
`protected int` `mStmtCID`
`protected int` `mTargetResultSetConcurrency`
`protected int` `mTargetResultSetType`
`protected java.sql.SQLWarning` `mWarning`

### Fields inherited from interface java.sql.Statement

`CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `addBatch(java.lang.String aSql)`
`protected void` `afterExecution()`
`void` `cancel()`
`protected void` `clearAllResults()`
`void` `clearBatch()`
`void` `clearWarnings()`
`void` `close()`
`void` `closeOnCompletion()`
`protected static AltibaseStatement` `createInternalStatement(AltibaseConnection sConnection)` Internal statement 생성한다.
`protected void` `createProtocolContext()`
`protected int` `downgradeFetchSize(int aRows)` Dynamic Array에서 허용할 수 있는 최대 범위로 fetchSize를 보정한다.
`boolean` `execute(java.lang.String aSql)`
`boolean` `execute(java.lang.String aSql, int aAutoGeneratedKeys)`
`boolean` `execute(java.lang.String aSql, int[] aColumnIndexes)`
`boolean` `execute(java.lang.String aSql, java.lang.String[] aColumnNames)`
`int[]` `executeBatch()`
`long[]` `executeLargeBatch()`
`long` `executeLargeUpdate(java.lang.String aSql)`
`java.sql.ResultSet` `executeQuery(java.lang.String aSql)`
`int` `executeUpdate(java.lang.String aSql)`
`int` `executeUpdate(java.lang.String aSql, int aAutoGeneratedKeys)`
`int` `executeUpdate(java.lang.String aSql, int[] aColumnIndexes)`
`int` `executeUpdate(java.lang.String aSql, java.lang.String[] aColumnNames)`
`java.sql.Connection` `getConnection()`
`java.lang.String` `getExplainPlan()` Plan text를 얻는다.
`int` `getFetchDirection()`
`int` `getFetchSize()`
`java.sql.ResultSet` `getGeneratedKeys()`
`long` `getLargeMaxRows()`
`long` `getLargeUpdateCount()`
`protected static int` `getMaxFetchSize()` 최대 fetch size 를 반환한다.
`int` `getMaxFieldSize()`
`int` `getMaxRows()`
`boolean` `getMoreResults()`
`boolean` `getMoreResults(int current)`
`protected CmProtocolContextDirExec` `getProtocolContext()`
`int` `getQueryTimeout()`
`java.sql.ResultSet` `getResultSet()`
`int` `getResultSetConcurrency()`
`int` `getResultSetHoldability()`
`int` `getResultSetType()`
`protected java.lang.String` `getSql()`
`int` `getUpdateCount()`
`java.sql.SQLWarning` `getWarnings()`
`protected void` `incCurrentResultSetIndex()`
`protected boolean` `isAsyncPrefetch()` 비동기적으로 fetch 를 수행하고 있는 statement 여부인지 확인한다.
`boolean` `isClosed()` Statement가 닫혔는지 확인한다.
`boolean` `isCloseOnCompletion()`
`protected boolean` `isInternalStatement()` Internal statement 여부를 확인하다.
`protected boolean` `isPingSQL(java.lang.String aSql)` sql이 validation check용 ping 쿼리인지 여부를 정규 표현식을 이용해 판별한다.
`boolean` `isPoolable()`
`protected void` `pingAndCreateLightweightResultSet()` 내부적으로 ping메소드를 호출한 다음 정상적일 경우 SELECT 1의 결과에 해당하는 row를 수동으로 생성한 후 반환한다.
`protected java.lang.String` `procDowngradeAndGetTargetSql(java.lang.String aOrgQstr)` Downgrade가 필요하면 처리하고, 실제 사용할 변환된 쿼리문을 얻는다.
`protected java.sql.ResultSet` `processExecutionQueryResult(java.lang.String aSql)`
`protected boolean` `processExecutionResult()`
`void` `setCursorName(java.lang.String aName)`
`void` `setEscapeProcessing(boolean aEnable)`
`void` `setFetchDirection(int aDirection)`
`void` `setFetchSize(int aRows)`
`void` `setLargeMaxRows(long aMax)`
`void` `setMaxFieldSize(int aMax)`
`void` `setMaxRows(int aMax)`
`void` `setPoolable(boolean aPoolable)`
`void` `setQueryTimeout(int aSeconds)`
`void` `setSql(java.lang.String aSql)`
`protected int` `toInt(long aUpdateCount)`
`protected int[]` `toIntBatchUpdateCounts(long[] aLongUpdateCounts)`
`java.lang.String` `toString()`

### Methods inherited from class Altibase.jdbc.driver.WrapperAdapter

`isWrapperFor, unwrap`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.sql.Statement

`executeLargeUpdate, executeLargeUpdate, executeLargeUpdate`

### Methods inherited from interface java.sql.Wrapper

`isWrapperFor, unwrap`

### Field Detail

#### BYTES_PER_CHAR

    public static final int BYTES_PER_CHAR

See Also:
  Constant Field Values

#### mConnection

    protected AltibaseConnection mConnection

#### mEscapeProcessing

    protected boolean mEscapeProcessing

#### mExecuteResultMgr

    protected AltibaseStatement.ExecuteResultManager mExecuteResultMgr

#### mCurrentResultIndex

    protected short mCurrentResultIndex

#### mCurrentResultSet

    protected AltibaseResultSet mCurrentResultSet

#### mResultSetList

    protected java.util.List<java.sql.ResultSet> mResultSetList

#### mIsClosed

    protected boolean mIsClosed

#### mWarning

    protected java.sql.SQLWarning mWarning

#### mFetchSize

    protected int mFetchSize

#### mMaxFieldSize

    protected int mMaxFieldSize

#### mMaxRows

    protected long mMaxRows

#### mPrepareResult

    protected CmPrepareResult mPrepareResult

#### mPrepareResultColumns

    protected java.util.List<Column> mPrepareResultColumns

#### mExecutionResult

    protected CmExecutionResult mExecutionResult

#### mFetchResult

    protected CmFetchResult mFetchResult

#### mStmtCID

    protected int mStmtCID

#### mIsDeferred

    protected boolean mIsDeferred

#### mForceClobBind

    protected boolean mForceClobBind

#### mBatchSetBytesUseLob

    protected boolean mBatchSetBytesUseLob

#### mQstr

    protected java.lang.String mQstr

#### mReUseResultSet

    protected boolean mReUseResultSet

#### mResultSetReturned

    protected boolean mResultSetReturned

#### mTargetResultSetType

    protected int mTargetResultSetType

#### mTargetResultSetConcurrency

    protected int mTargetResultSetConcurrency

#### EMPTY_LARGE_BATCH_RESULT

    protected static final long[] EMPTY_LARGE_BATCH_RESULT

### Method Detail

#### getSql

    protected java.lang.String getSql()

#### setSql

    public void setSql(java.lang.String aSql)

#### createProtocolContext

    protected void createProtocolContext()

#### getProtocolContext

    protected CmProtocolContextDirExec getProtocolContext()

#### afterExecution

    protected void afterExecution()
                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### clearAllResults

    protected void clearAllResults()
                            throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### processExecutionResult

    protected boolean processExecutionResult()
                                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### processExecutionQueryResult

    protected java.sql.ResultSet processExecutionQueryResult(java.lang.String aSql)
                                                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### addBatch

    public void addBatch(java.lang.String aSql)
                  throws java.sql.SQLException

Specified by:
  `addBatch` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### cancel

    public void cancel()
                throws java.sql.SQLException

Specified by:
  `cancel` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### clearBatch

    public void clearBatch()
                    throws java.sql.SQLException

Specified by:
  `clearBatch` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### clearWarnings

    public void clearWarnings()
                       throws java.sql.SQLException

Specified by:
  `clearWarnings` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### close

    public void close()
               throws java.sql.SQLException

Specified by:
  `close` in interface `java.lang.AutoCloseable`
Specified by:
  `close` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### execute

    public boolean execute(java.lang.String aSql,
                           int aAutoGeneratedKeys)
                    throws java.sql.SQLException

Specified by:
  `execute` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### execute

    public boolean execute(java.lang.String aSql,
                           int[] aColumnIndexes)
                    throws java.sql.SQLException

Specified by:
  `execute` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### execute

    public boolean execute(java.lang.String aSql,
                           java.lang.String[] aColumnNames)
                    throws java.sql.SQLException

Specified by:
  `execute` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### execute

    public boolean execute(java.lang.String aSql)
                    throws java.sql.SQLException

Specified by:
  `execute` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeBatch

    public int[] executeBatch()
                       throws java.sql.SQLException

Specified by:
  `executeBatch` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeLargeBatch

    public long[] executeLargeBatch()
                             throws java.sql.SQLException

Specified by:
  `executeLargeBatch` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeQuery

    public java.sql.ResultSet executeQuery(java.lang.String aSql)
                                    throws java.sql.SQLException

Specified by:
  `executeQuery` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### pingAndCreateLightweightResultSet

    protected void pingAndCreateLightweightResultSet()
                                              throws java.sql.SQLException

내부적으로 ping메소드를 호출한 다음 정상적일 경우 SELECT 1의 결과에 해당하는 row를 수동으로 생성한 후 반환한다.

Throws:
  `java.sql.SQLException` - Column객체에 setValue를 수행했을때 에러가 발생한 경우.

#### isPingSQL

    protected boolean isPingSQL(java.lang.String aSql)

sql이 validation check용 ping 쿼리인지 여부를 정규 표현식을 이용해 판별한다.

Parameters:
  `aSql` - 쿼리 스트링
Returns:
  ping 쿼리인지 여부

#### executeUpdate

    public int executeUpdate(java.lang.String aSql,
                             int aAutoGeneratedKeys)
                      throws java.sql.SQLException

Specified by:
  `executeUpdate` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeUpdate

    public int executeUpdate(java.lang.String aSql,
                             int[] aColumnIndexes)
                      throws java.sql.SQLException

Specified by:
  `executeUpdate` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeUpdate

    public int executeUpdate(java.lang.String aSql,
                             java.lang.String[] aColumnNames)
                      throws java.sql.SQLException

Specified by:
  `executeUpdate` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeUpdate

    public int executeUpdate(java.lang.String aSql)
                      throws java.sql.SQLException

Specified by:
  `executeUpdate` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getConnection

    public java.sql.Connection getConnection()
                                      throws java.sql.SQLException

Specified by:
  `getConnection` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getFetchDirection

    public int getFetchDirection()
                          throws java.sql.SQLException

Specified by:
  `getFetchDirection` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getFetchSize

    public int getFetchSize()
                     throws java.sql.SQLException

Specified by:
  `getFetchSize` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getGeneratedKeys

    public java.sql.ResultSet getGeneratedKeys()
                                        throws java.sql.SQLException

Specified by:
  `getGeneratedKeys` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getMaxFieldSize

    public int getMaxFieldSize()
                        throws java.sql.SQLException

Specified by:
  `getMaxFieldSize` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getMaxRows

    public int getMaxRows()
                   throws java.sql.SQLException

Specified by:
  `getMaxRows` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getMoreResults

    public boolean getMoreResults()
                           throws java.sql.SQLException

Specified by:
  `getMoreResults` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### incCurrentResultSetIndex

    protected void incCurrentResultSetIndex()

#### getMoreResults

    public boolean getMoreResults(int current)
                           throws java.sql.SQLException

Specified by:
  `getMoreResults` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getQueryTimeout

    public int getQueryTimeout()
                        throws java.sql.SQLException

Specified by:
  `getQueryTimeout` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getResultSet

    public java.sql.ResultSet getResultSet()
                                    throws java.sql.SQLException

Specified by:
  `getResultSet` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getResultSetConcurrency

    public int getResultSetConcurrency()
                                throws java.sql.SQLException

Specified by:
  `getResultSetConcurrency` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getResultSetHoldability

    public int getResultSetHoldability()
                                throws java.sql.SQLException

Specified by:
  `getResultSetHoldability` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getResultSetType

    public int getResultSetType()
                         throws java.sql.SQLException

Specified by:
  `getResultSetType` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getUpdateCount

    public int getUpdateCount()
                       throws java.sql.SQLException

Specified by:
  `getUpdateCount` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getWarnings

    public java.sql.SQLWarning getWarnings()
                                    throws java.sql.SQLException

Specified by:
  `getWarnings` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### isClosed

    public boolean isClosed()
                     throws java.sql.SQLException

Statement가 닫혔는지 확인한다.

Specified by:
  `isClosed` in interface `java.sql.Statement`
Returns:
  close가 잘 수행되었거나 이미 Connection이 close되었으면 true, 아니면 false
Throws:
  `java.sql.SQLException`

#### setCursorName

    public void setCursorName(java.lang.String aName)
                       throws java.sql.SQLException

Specified by:
  `setCursorName` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setEscapeProcessing

    public void setEscapeProcessing(boolean aEnable)
                             throws java.sql.SQLException

Specified by:
  `setEscapeProcessing` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setFetchDirection

    public void setFetchDirection(int aDirection)
                           throws java.sql.SQLException

Specified by:
  `setFetchDirection` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setFetchSize

    public void setFetchSize(int aRows)
                      throws java.sql.SQLException

Specified by:
  `setFetchSize` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### downgradeFetchSize

    protected int downgradeFetchSize(int aRows)

Dynamic Array에서 허용할 수 있는 최대 범위로 fetchSize를 보정한다.

Parameters:
  `aRows` - fetchSize

#### getMaxFetchSize

    protected static int getMaxFetchSize()

최대 fetch size 를 반환한다.

#### setMaxFieldSize

    public void setMaxFieldSize(int aMax)
                         throws java.sql.SQLException

Specified by:
  `setMaxFieldSize` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setMaxRows

    public void setMaxRows(int aMax)
                    throws java.sql.SQLException

Specified by:
  `setMaxRows` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setQueryTimeout

    public void setQueryTimeout(int aSeconds)
                         throws java.sql.SQLException

Specified by:
  `setQueryTimeout` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getExplainPlan

    public java.lang.String getExplainPlan()
                                    throws java.sql.SQLException

Plan text를 얻는다.

Returns:
  Plan text
Throws:
  `java.sql.SQLException` - Plan text 요청이나 결과를 얻는데 실패했을 때

#### procDowngradeAndGetTargetSql

    protected final java.lang.String procDowngradeAndGetTargetSql(java.lang.String aOrgQstr)
                                                           throws java.sql.SQLException

Downgrade가 필요하면 처리하고, 실제 사용할 변환된 쿼리문을 얻는다.

만약 Downgrade나 쿼리 변환이 필요 없다면 조용히 넘어가고 원본 쿼리문을 반환한다.

Parameters:
  `aOrgQstr` - 원본 쿼리문
Returns:
  실제로 사용할 쿼리문
Throws:
  `java.sql.SQLException` - Downgrade 여부 확인 또는 Downgrade에 실패한 경우

#### isAsyncPrefetch

    protected boolean isAsyncPrefetch()

비동기적으로 fetch 를 수행하고 있는 statement 여부인지 확인한다.

#### createInternalStatement

    protected static AltibaseStatement createInternalStatement(AltibaseConnection sConnection)
                                                        throws java.sql.SQLException

Internal statement 생성한다.

Throws:
  `java.sql.SQLException`

#### isInternalStatement

    protected boolean isInternalStatement()

Internal statement 여부를 확인하다.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### closeOnCompletion

    public void closeOnCompletion()
                           throws java.sql.SQLException

Specified by:
  `closeOnCompletion` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### isCloseOnCompletion

    public boolean isCloseOnCompletion()
                                throws java.sql.SQLException

Specified by:
  `isCloseOnCompletion` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### executeLargeUpdate

    public long executeLargeUpdate(java.lang.String aSql)
                            throws java.sql.SQLException

Specified by:
  `executeLargeUpdate` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getLargeUpdateCount

    public long getLargeUpdateCount()
                             throws java.sql.SQLException

Specified by:
  `getLargeUpdateCount` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### getLargeMaxRows

    public long getLargeMaxRows()
                         throws java.sql.SQLException

Specified by:
  `getLargeMaxRows` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setLargeMaxRows

    public void setLargeMaxRows(long aMax)
                         throws java.sql.SQLException

Specified by:
  `setLargeMaxRows` in interface `java.sql.Statement`
Throws:
  `java.sql.SQLException`

#### setPoolable

    public void setPoolable(boolean aPoolable)

Specified by:
  `setPoolable` in interface `java.sql.Statement`

#### isPoolable

    public boolean isPoolable()

Specified by:
  `isPoolable` in interface `java.sql.Statement`

#### toIntBatchUpdateCounts

    protected int[] toIntBatchUpdateCounts(long[] aLongUpdateCounts)

#### toInt

    protected int toInt(long aUpdateCount)