Altibase.jdbc.driver.cm

## Class CmProtocol

- java.lang.Object
- - Altibase.jdbc.driver.cm.CmProtocol

    public class CmProtocol
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`CmProtocol()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `cancelStatement(CmProtocolContextDirExec aContext, int aCID)`
`static void` `clientCommit(CmProtocolContext aContext, boolean aClientSideAutoCommit)` ClientSideAutoCommit이 on인 경우에만 서버로 commit 메세지를 전송한다.
`static void` `closeCursor(CmProtocolContextDirExec aContext, int aStmtID, short aResultSetID, boolean aClientSideAutoCommit)`
`static void` `commit(CmProtocolContext aContext)`
`static void` `connect(CmProtocolContextConnect aContext, java.lang.String aDBName, java.lang.String aUser, java.lang.String aPassword, short aConnectMode, ShardConnType aShardConnType)`
`static void` `directExecute(CmProtocolContextDirExec aContext, int aCID, java.lang.String aSql, boolean aHoldable, boolean aForKeySetDriven, boolean aNliteralReplace, boolean aClientSideAutoCommit, boolean aShouldCloseCursor)`
`static void` `directExecuteAndFetch(CmProtocolContextDirExec aContext, int aCID, java.lang.String aSql, int aFetchCount, long aMaxRows, int aMaxFieldSize, boolean aHoldable, boolean aForKeySetDriven, boolean aNliteralReplace, boolean aShouldCloseCursor)`
`static void` `directExecuteBatch(CmProtocolContextDirExec aContext, int aCID, java.lang.String[] aSql, boolean aNliteralReplace, boolean aClientSideAutoCommit)`
`static void` `disconnect(CmProtocolContextConnect aContext)`
`static void` `fetch(CmProtocolContextDirExec aContext, int aFetchCount, long aMaxRows, int aMaxFieldSize)`
`static void` `fetchNext(CmProtocolContextDirExec aContext, int aFetchCount)`
`static void` `free(CmProtocolContextLob aContext)`
`static void` `freeStatement(CmProtocolContextDirExec aContext, int aStmtID)`
`static void` `getBlob(CmProtocolContextLob aContext, long aServerOffset, long aLength)`
`static void` `getBytePos(CmProtocolContextLob aContext, int aCharLength)`
`static void` `getCharLength(CmProtocolContextLob aContext)`
`static void` `getClobBytePos(CmProtocolContextLob aContext, long aByteOffset, long aCharLength)`
`static void` `getClobCharPos(CmProtocolContextLob aContext, long aCharOffset, long aCharLength)`
`static void` `getLobByteLength(CmProtocolContextLob aContext)`
`static void` `getPlan(CmProtocolContext aContext, int aStmtID, java.util.List aDeferredRequests)` Statement ID에 해당하는 Plan text를 얻는다.
`static void` `getProperty(CmProtocolContextConnect aContext, byte aPropCode)`
`static void` `handshake(CmProtocolContextConnect aContext)`
`static void` `invokeDeferredRequests(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> aDeferredRequests)`
`static void` `prepare(CmProtocolContextDirExec aContext, int aCID, java.lang.String aSql, boolean aHoldable, boolean aForKeySetDriven, boolean aNliteralReplace, boolean aIsDeferred)`
`static void` `preparedExecute(CmProtocolContextPrepExec aContext, java.util.List<Column> aParams, boolean aClientSideAutoCommit, boolean aShouldCloseCursor)`
`static void` `preparedExecuteAndFetch(CmProtocolContextPrepExec aContext, java.util.List<Column> aParams, int aFetchCount, long aMaxRows, int aMaxFieldSize, boolean aShouldCloseCursor)`
`static void` `preparedExecuteBatch(CmProtocolContextPrepExec aContext, java.util.List<Column> aParams, DynamicArrayRowHandle aRowHandle, int aRowCount)`
`static void` `preparedExecuteBatchUsingList(CmProtocolContextPrepExec aContext, java.util.List<Column> aParams, ListBufferHandle aBufferHandle, int aRowCount, boolean aIsAtomic)`
`static void` `putBlob(CmProtocolContextLob aContext, long aServerOffset, byte[] aSource, int aSourceOffset, int aSourceLength)`
`static void` `putBlob(CmProtocolContextLob aContext, long aServerOffset, java.io.InputStream aSource, long aSourceLength)`
`static long` `putClob(CmProtocolContextLob aContext, long aServerOffset, char[] aSrc)` CLob 데이타를 서버로 보낸다.
`static long` `putClob(CmProtocolContextLob aContext, long aServerOffset, char[] aSrc, int aSrcOffset, int aSrcLength)` CLob 데이타를 서버로 보낸다.
`static long` `putClob(CmProtocolContextLob aContext, long aServerOffset, java.io.Reader aSource, int aSourceLength)` CLob 데이타를 서버로 보낸다.
`protected static void` `readProtocolResult(CmProtocolContext aContext)` 프로토콜을 해석한다.
`static void` `receivefetchNextAsync(CmProtocolContextDirExec aContext)` 비동기적으로 송신한 fetch 프로토콜을 수신한다.
`static void` `rollback(CmProtocolContext aContext)`
`static void` `sendFetchNextAsync(CmProtocolContextDirExec aContext, int aFetchCount)` 비동기적으로 fetch 프로토콜을 송신한다.
`static void` `sendProperties(CmProtocolContextConnect aContext)`
`static void` `shardHandshake(CmProtocolContextConnect aContext)` Meta 서버와 Data 노드에 shard handshake 프로토콜을 보낸다.
`static void` `truncate(CmProtocolContextLob aContext, int aLength)`
`static void` `writeGetBindParamInfo(CmProtocolContextDirExec aContext)`
`static void` `xaClose(CmProtocolContextXA aContext)`
`static void` `xaCommit(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid, long aFlag)`
`static void` `xaEnd(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid, long aFlag)`
`static void` `xaForget(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid)`
`static void` `xaOpen(CmProtocolContextXA aContext)`
`static void` `xaPrepare(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid)`
`static void` `xaRecover(CmProtocolContextXA aContext, int aFlag)`
`static void` `xaRollback(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid)`
`static void` `xaStart(CmProtocolContextXA aContext, javax.transaction.xa.Xid aXid, long aFlag)`

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

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

### Constructor Detail

#### CmProtocol

    public CmProtocol()

### Method Detail

#### handshake

    public static void handshake(CmProtocolContextConnect aContext)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### shardHandshake

    public static void shardHandshake(CmProtocolContextConnect aContext)
                               throws java.sql.SQLException

Meta 서버와 Data 노드에 shard handshake 프로토콜을 보낸다.

Parameters:
  `aContext` - ContextConnect 객체
Throws:
  `java.sql.SQLException` - shardHandshake 도중 에러가 발생했을 때

#### connect

    public static void connect(CmProtocolContextConnect aContext,
                               java.lang.String aDBName,
                               java.lang.String aUser,
                               java.lang.String aPassword,
                               short aConnectMode,
                               ShardConnType aShardConnType)
                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getProperty

    public static void getProperty(CmProtocolContextConnect aContext,
                                   byte aPropCode)
                            throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### sendProperties

    public static void sendProperties(CmProtocolContextConnect aContext)
                               throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### disconnect

    public static void disconnect(CmProtocolContextConnect aContext)
                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### commit

    public static void commit(CmProtocolContext aContext)
                       throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### rollback

    public static void rollback(CmProtocolContext aContext)
                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### directExecute

    public static void directExecute(CmProtocolContextDirExec aContext,
                                     int aCID,
                                     java.lang.String aSql,
                                     boolean aHoldable,
                                     boolean aForKeySetDriven,
                                     boolean aNliteralReplace,
                                     boolean aClientSideAutoCommit,
                                     boolean aShouldCloseCursor)
                              throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### clientCommit

    public static void clientCommit(CmProtocolContext aContext,
                                    boolean aClientSideAutoCommit)
                             throws java.sql.SQLException

ClientSideAutoCommit이 on인 경우에만 서버로 commit 메세지를 전송한다.

Parameters:
  `aContext` - CmProtocolContext 객체
Throws:
  `java.sql.SQLException` - commit시 에러가 발생한 경우

#### fetch

    public static void fetch(CmProtocolContextDirExec aContext,
                             int aFetchCount,
                             long aMaxRows,
                             int aMaxFieldSize)
                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### fetchNext

    public static void fetchNext(CmProtocolContextDirExec aContext,
                                 int aFetchCount)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### sendFetchNextAsync

    public static void sendFetchNextAsync(CmProtocolContextDirExec aContext,
                                          int aFetchCount)
                                   throws java.sql.SQLException

비동기적으로 fetch 프로토콜을 송신한다.

Parameters:
  `aContext` - Protocol context
  `aFetchCount` - fetch 를 요청할 row 수
Throws:
  `java.sql.SQLException` - 송수신 과정에서 에러가 발생하였을 경우

#### receivefetchNextAsync

    public static void receivefetchNextAsync(CmProtocolContextDirExec aContext)
                                      throws java.sql.SQLException

비동기적으로 송신한 fetch 프로토콜을 수신한다.

Parameters:
  `aContext` - Protocol context
Throws:
  `java.sql.SQLException` - 송수신 과정에서 에러가 발생하였을 경우

#### directExecuteBatch

    public static void directExecuteBatch(CmProtocolContextDirExec aContext,
                                          int aCID,
                                          java.lang.String[] aSql,
                                          boolean aNliteralReplace,
                                          boolean aClientSideAutoCommit)
                                   throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### directExecuteAndFetch

    public static void directExecuteAndFetch(CmProtocolContextDirExec aContext,
                                             int aCID,
                                             java.lang.String aSql,
                                             int aFetchCount,
                                             long aMaxRows,
                                             int aMaxFieldSize,
                                             boolean aHoldable,
                                             boolean aForKeySetDriven,
                                             boolean aNliteralReplace,
                                             boolean aShouldCloseCursor)
                                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### prepare

    public static void prepare(CmProtocolContextDirExec aContext,
                               int aCID,
                               java.lang.String aSql,
                               boolean aHoldable,
                               boolean aForKeySetDriven,
                               boolean aNliteralReplace,
                               boolean aIsDeferred)
                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### writeGetBindParamInfo

    public static void writeGetBindParamInfo(CmProtocolContextDirExec aContext)
                                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### preparedExecute

    public static void preparedExecute(CmProtocolContextPrepExec aContext,
                                       java.util.List<Column> aParams,
                                       boolean aClientSideAutoCommit,
                                       boolean aShouldCloseCursor)
                                throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### preparedExecuteBatch

    public static void preparedExecuteBatch(CmProtocolContextPrepExec aContext,
                                            java.util.List<Column> aParams,
                                            DynamicArrayRowHandle aRowHandle,
                                            int aRowCount)
                                     throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### preparedExecuteBatchUsingList

    public static void preparedExecuteBatchUsingList(CmProtocolContextPrepExec aContext,
                                                     java.util.List<Column> aParams,
                                                     ListBufferHandle aBufferHandle,
                                                     int aRowCount,
                                                     boolean aIsAtomic)
                                              throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### preparedExecuteAndFetch

    public static void preparedExecuteAndFetch(CmProtocolContextPrepExec aContext,
                                               java.util.List<Column> aParams,
                                               int aFetchCount,
                                               long aMaxRows,
                                               int aMaxFieldSize,
                                               boolean aShouldCloseCursor)
                                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### closeCursor

    public static void closeCursor(CmProtocolContextDirExec aContext,
                                   int aStmtID,
                                   short aResultSetID,
                                   boolean aClientSideAutoCommit)
                            throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### freeStatement

    public static void freeStatement(CmProtocolContextDirExec aContext,
                                     int aStmtID)
                              throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### cancelStatement

    public static void cancelStatement(CmProtocolContextDirExec aContext,
                                       int aCID)
                                throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getLobByteLength

    public static void getLobByteLength(CmProtocolContextLob aContext)
                                 throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getBlob

    public static void getBlob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               long aLength)
                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### putBlob

    public static void putBlob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               byte[] aSource,
                               int aSourceOffset,
                               int aSourceLength)
                        throws java.sql.SQLException,
                               java.io.IOException

Throws:
  `java.sql.SQLException`
  `java.io.IOException`

#### putBlob

    public static void putBlob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               java.io.InputStream aSource,
                               long aSourceLength)
                        throws java.sql.SQLException,
                               java.io.IOException

Throws:
  `java.sql.SQLException`
  `java.io.IOException`

#### truncate

    public static void truncate(CmProtocolContextLob aContext,
                                int aLength)
                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### free

    public static void free(CmProtocolContextLob aContext)
                     throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getCharLength

    public static void getCharLength(CmProtocolContextLob aContext)
                              throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getBytePos

    public static void getBytePos(CmProtocolContextLob aContext,
                                  int aCharLength)
                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getClobBytePos

    public static void getClobBytePos(CmProtocolContextLob aContext,
                                      long aByteOffset,
                                      long aCharLength)
                               throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getClobCharPos

    public static void getClobCharPos(CmProtocolContextLob aContext,
                                      long aCharOffset,
                                      long aCharLength)
                               throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### putClob

    public static long putClob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               char[] aSrc)
                        throws java.sql.SQLException,
                               java.io.IOException

CLob 데이타를 서버로 보낸다.

Parameters:
  `aContext` - 프로토콜 컨텍스트
  `aServerOffset` - 데이타를 반영할 서버 데이타의 기준 위치(byte 단위)
  `aSrc` - 보낼 데이타
Returns:
  보낸 데이타 사이즈(byte 단위)
Throws:
  `java.sql.SQLException` - 프로토콜을 쓰는데 실패했을 경우
  `java.io.IOException` - 데이타를 읽는데 실패했을 경우

#### putClob

    public static long putClob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               char[] aSrc,
                               int aSrcOffset,
                               int aSrcLength)
                        throws java.sql.SQLException,
                               java.io.IOException

CLob 데이타를 서버로 보낸다.

Parameters:
  `aContext` - 프로토콜 컨텍스트
  `aServerOffset` - 데이타를 반영할 서버 데이타의 기준 위치(byte 단위)
  `aSrc` - 보낼 데이타
  `aSrcOffset` - 보내기 시작할 위치
  `aSrcLength` - 보낼 길이
Returns:
  보낸 데이타 사이즈(byte 단위)
Throws:
  `java.sql.SQLException` - 프로토콜을 쓰는데 실패했을 경우
  `java.io.IOException` - 데이타를 읽는데 실패했을 경우

#### putClob

    public static long putClob(CmProtocolContextLob aContext,
                               long aServerOffset,
                               java.io.Reader aSource,
                               int aSourceLength)
                        throws java.sql.SQLException,
                               java.io.IOException

CLob 데이타를 서버로 보낸다.

Parameters:
  `aContext` - 프로토콜 컨텍스트
  `aServerOffset` - 데이타를 반영할 서버 데이타의 기준 위치(byte 단위)
  `aSource` - 보낼 데이타
  `aSourceLength` - 보낼 데이타 길이
Returns:
  보낸 데이타 사이즈(byte 단위)
Throws:
  `java.sql.SQLException` - 프로토콜을 쓰는데 실패했을 경우
  `java.io.IOException` - 데이타를 읽는데 실패했을 경우

#### xaOpen

    public static void xaOpen(CmProtocolContextXA aContext)
                       throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaClose

    public static void xaClose(CmProtocolContextXA aContext)
                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaPrepare

    public static void xaPrepare(CmProtocolContextXA aContext,
                                 javax.transaction.xa.Xid aXid)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaCommit

    public static void xaCommit(CmProtocolContextXA aContext,
                                javax.transaction.xa.Xid aXid,
                                long aFlag)
                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaRollback

    public static void xaRollback(CmProtocolContextXA aContext,
                                  javax.transaction.xa.Xid aXid)
                           throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaStart

    public static void xaStart(CmProtocolContextXA aContext,
                               javax.transaction.xa.Xid aXid,
                               long aFlag)
                        throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaEnd

    public static void xaEnd(CmProtocolContextXA aContext,
                             javax.transaction.xa.Xid aXid,
                             long aFlag)
                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaForget

    public static void xaForget(CmProtocolContextXA aContext,
                                javax.transaction.xa.Xid aXid)
                         throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### xaRecover

    public static void xaRecover(CmProtocolContextXA aContext,
                                 int aFlag)
                          throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### getPlan

    public static void getPlan(CmProtocolContext aContext,
                               int aStmtID,
                               java.util.List aDeferredRequests)
                        throws java.sql.SQLException

Statement ID에 해당하는 Plan text를 얻는다.

Parameters:
  `aContext` - Protocol context
  `aStmtID` - Plan text를 얻을 Statement의 ID
  `aDeferredRequests` - deferred된 prepare요청
Throws:
  `java.sql.SQLException` - 요청을 보내지 못했거나, 또는 Plan text를 얻을 수 없는 경우

#### readProtocolResult

    protected static void readProtocolResult(CmProtocolContext aContext)
                                      throws java.sql.SQLException

프로토콜을 해석한다. 만약, 비동기적으로 요청한 프로토콜이 있다면 먼저 해석한다.

Parameters:
  `aContext` - Protocol context
Throws:
  `java.sql.SQLException` - 수신 도중 에러가 발생하였을 경우

#### invokeDeferredRequests

    public static void invokeDeferredRequests(java.util.List<java.util.Map<java.lang.String,java.lang.Object>> aDeferredRequests)