kr.co.hit.live.dao.helper
Class WSJdbcHelper

java.lang.Object
  extended by kr.co.hit.live.dao.helper.WSJdbcHelper

public class WSJdbcHelper
extends Object

WebSphere 사용시 WebSphere가 제공하는 DataSource 또는 Connection 객체를 다루기 위한 기능을 제공한다. WebSphere의 DataSource나 Connection 객체는 그것이 감싸고 있는 원래의 DataSource나 Connection 객체를 직접적으로 가져올 수 있는 방법을 제공하지 않으므로, com.ibm.websphere.rsadapter.WSCallHelper 클래스의 jdbcPass() 또는 jdbcCall() 메소드를 사용하여 간접적으로 내부 객체에 접근해야한다.

이 클래스는 WSCallHelper의 메소드들을 Reflection을 사용하여 호출하도록 기능을 제공한다. Reflection을 사용하는 이유는 직접 메소드 호출하는 방식의 코딩은 컴파일 단계에서 WebSphere가 제공하는 JAR 파일을 필요로 하기때문에 이를 피해가기 위해서이다.

Author:
kimhd

Field Summary
static int CALLABLE_STATEMENT
           
static int CONNECTION
           
static String CONSTRUCTOR
           
static int DATA_SOURCE
           
static int DATABASE_META_DATA
           
static int IGNORE
           
static int PREPARED_STATEMENT
           
static int RESULT_SET
           
static int STATEMENT
           
static String WSCALLHELPER_CLASSNAME
           
static String WSCONNECTION_CLASSNAME
           
static String WSDATASOURCE_CLASSNAME
           
 
Constructor Summary
WSJdbcHelper()
           
 
Method Summary
static boolean isWSConnection(Connection con)
          주어진 Connection 객체가 WebSphere의 Connection 객체인지 여부를 리턴한다.
static boolean isWSDataSource(DataSource ds)
          주어진 DataSource 객체가 WebSphere의 DataSource 객체인지 여부를 리턴한다.
static Object jdbcCall(Class<?> targetType, Object wrapperObj, String methodName, Object[] args, Class<?>[] types)
          WSCallHelper 클래스의 jdbcCall() 메소드를 호출한다.
static Object jdbcPass(Class<?> targetType, String methodName, Object[] args, Class<?>[] types, int[] unwrap)
          WSCallHelper 클래스의 jdbcPass() 메소드를 호출한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WSCALLHELPER_CLASSNAME

public static final String WSCALLHELPER_CLASSNAME
See Also:
Constant Field Values

WSCONNECTION_CLASSNAME

public static final String WSCONNECTION_CLASSNAME
See Also:
Constant Field Values

WSDATASOURCE_CLASSNAME

public static final String WSDATASOURCE_CLASSNAME
See Also:
Constant Field Values

DATA_SOURCE

public static final int DATA_SOURCE
See Also:
Constant Field Values

CONNECTION

public static final int CONNECTION
See Also:
Constant Field Values

STATEMENT

public static final int STATEMENT
See Also:
Constant Field Values

PREPARED_STATEMENT

public static final int PREPARED_STATEMENT
See Also:
Constant Field Values

CALLABLE_STATEMENT

public static final int CALLABLE_STATEMENT
See Also:
Constant Field Values

RESULT_SET

public static final int RESULT_SET
See Also:
Constant Field Values

DATABASE_META_DATA

public static final int DATABASE_META_DATA
See Also:
Constant Field Values

CONSTRUCTOR

public static final String CONSTRUCTOR
See Also:
Constant Field Values

IGNORE

public static final int IGNORE
See Also:
Constant Field Values
Constructor Detail

WSJdbcHelper

public WSJdbcHelper()
Method Detail

isWSConnection

public static boolean isWSConnection(Connection con)
주어진 Connection 객체가 WebSphere의 Connection 객체인지 여부를 리턴한다.

Parameters:
con -
Returns:

isWSDataSource

public static boolean isWSDataSource(DataSource ds)
주어진 DataSource 객체가 WebSphere의 DataSource 객체인지 여부를 리턴한다.

Parameters:
con -
Returns:

jdbcPass

public static Object jdbcPass(Class<?> targetType,
                              String methodName,
                              Object[] args,
                              Class<?>[] types,
                              int[] unwrap)
                       throws SQLException
WSCallHelper 클래스의 jdbcPass() 메소드를 호출한다.

Parameters:
targetType -
methodName -
args -
types -
unwrap -
Returns:
Throws:
SQLException

jdbcCall

public static Object jdbcCall(Class<?> targetType,
                              Object wrapperObj,
                              String methodName,
                              Object[] args,
                              Class<?>[] types)
                       throws SQLException
WSCallHelper 클래스의 jdbcCall() 메소드를 호출한다.

Parameters:
targetType -
wrapperObj -
methodName -
args -
types -
Returns:
Throws:
SQLException


Copyright © 2014. All Rights Reserved.