kr.co.hit.live.dao.supporter
Class DB2Supporter

java.lang.Object
  extended by kr.co.hit.live.dao.supporter.DbmsSupporter
      extended by kr.co.hit.live.dao.supporter.DB2Supporter

public class DB2Supporter
extends DbmsSupporter

DB2에서 지원해야 할 jdbc기능을 정의한다. Connection instance를 통해 자신이 알맞은 instance인지 판단하며,

Since:
4.0
Version:
$Revision: 1.1 $ $Date: 2006/09/26 08:20:21 $
Author:
최승일

Field Summary
static String DB2_XMLTYPE_NAME
           
protected  ColumnReader DB2XML
           
 
Fields inherited from class kr.co.hit.live.dao.supporter.DbmsSupporter
ARRAY, BIG_DECIMAL, BINARY_STREAM, BLOB, BOOLEAN, BYTE, CHAR_STREAM, CLOB, DATE, defMap, DOUBLE, globalResultMap, INT, LONG, OBJECT, postAdviceSqls, preAdviceSqls, REAL, SCALAR, SHORT, SIMPLEINT, STRING, TIME, TIMESTAMP
 
Constructor Summary
DB2Supporter()
           
 
Method Summary
 String generateTopSql(String fromSql, int topn)
          첫번째 topn 개의 row 만 조회하는 SQL 문장을 생성한다.
 ColumnReader getDefaultColumnReader(int type, String typeName)
           
 String getDummyTableName()
          더미 테이블 명을 반환한다.
 LiveException handleSqlException(SQLException sqlex)
          DBMS 별로 차이 있는 SQLException을 처리하여 LiveException으로 반환한다.
 boolean match(Connection conn)
           Connection instance를 통해 자신이 알맞은 Dbms의 supporter인지 판단한다.
 PreparedStatement preparePageStatement(Connection conn, String sql, List<Object> parameters, int offset, int maxCount, Map<String,Object> args)
          Map에 offset과 max_cnt, sort_field, parameters가 설정되어 있어야 하며 설정된 값을 PreparedStatement에 설정하여
반환한다.
 
Methods inherited from class kr.co.hit.live.dao.supporter.DbmsSupporter
executePostAdviceSql, executePreAdviceSql, getColumnReader, getDefintionValue, getInstance, getVendorName, prepareStatement, setCallableStatementOutParam, setCallableStatementParam, setDefaultCallableStatementOutParam, setDefaultCallableStatementParam, setDefaultPreparedStatementParam, setPreparedStatementParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB2_XMLTYPE_NAME

public static final String DB2_XMLTYPE_NAME
See Also:
Constant Field Values

DB2XML

protected final ColumnReader DB2XML
Constructor Detail

DB2Supporter

public DB2Supporter()
Method Detail

match

public boolean match(Connection conn)
              throws SQLException

Connection instance를 통해 자신이 알맞은 Dbms의 supporter인지 판단한다.

Specified by:
match in class DbmsSupporter
Returns:
Connection에 해당하는 Dbms를 support 가능한지의 여부.
Throws:
SQLException

getDefaultColumnReader

public ColumnReader getDefaultColumnReader(int type,
                                           String typeName)
Overrides:
getDefaultColumnReader in class DbmsSupporter

preparePageStatement

public PreparedStatement preparePageStatement(Connection conn,
                                              String sql,
                                              List<Object> parameters,
                                              int offset,
                                              int maxCount,
                                              Map<String,Object> args)
                                       throws SQLException
Map에 offset과 max_cnt, sort_field, parameters가 설정되어 있어야 하며 설정된 값을 PreparedStatement에 설정하여
반환한다. ex) sort field의 설정예 order by id asc : id column으로 오름차순 정렬. order by id desc : id column으로 내림차순 정렬.

Specified by:
preparePageStatement in class DbmsSupporter
Parameters:
con -
sql -
parameters -
offset - 시작위치
maxCount - 가져올 최대건수
args - sort_field(정렬옵션) 등 추가적으로 설정할 값
Returns:
Throws:
SQLException

handleSqlException

public LiveException handleSqlException(SQLException sqlex)
Description copied from class: DbmsSupporter
DBMS 별로 차이 있는 SQLException을 처리하여 LiveException으로 반환한다.

Overrides:
handleSqlException in class DbmsSupporter
Returns:
LiveException

getDummyTableName

public String getDummyTableName()
Description copied from class: DbmsSupporter
더미 테이블 명을 반환한다. (예 : oracle은 "DUAL")

Specified by:
getDummyTableName in class DbmsSupporter
Returns:

generateTopSql

public String generateTopSql(String fromSql,
                             int topn)
Description copied from class: DbmsSupporter
첫번째 topn 개의 row 만 조회하는 SQL 문장을 생성한다.

Specified by:
generateTopSql in class DbmsSupporter
Parameters:
fromSql - 조회대상 테이블 명 또는 SQL문
topn - 조회 건
Returns:


Copyright © 2014. All Rights Reserved.