|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkr.co.hit.live.dao.helper.OracleTypeHelper
public class OracleTypeHelper
OracleDB 사용시 BLOB, CLOB, ARRAY, XMLType 등의 타입변환을 지원하기위한 클래스.
제공되는 메소드들은 static이므로 Class scope로 사용된다.
Connection con = dao.getCurrentConnection(); String str = " <root> Person </root>"; OracleTypeHelper.getCLOB(con,str);
| Constructor Summary | |
|---|---|
OracleTypeHelper()
|
|
| Method Summary | |
|---|---|
static oracle.sql.ARRAY |
getARRAY(Connection con,
String typeName,
Object obj)
Oracle 용 ARRAY 타입 객체를 생성하는 메소드 |
static oracle.sql.BLOB |
getBLOB(Connection con,
byte[] bytes)
바이트 배열 데이터로 부터 BLOB(Binary Large OBject) 객체를 생성하여 리턴한다. |
static byte[] |
getBytes(oracle.sql.BLOB blob)
BLOB 객체의 내용을 바이트 배열로 변환하여 리턴하는 메소드. |
static oracle.sql.CLOB |
getCLOB(Connection con,
char[] str)
문자열 데이터로 부터 CLOB(Character Large OBject) 객체를 생성하여 리턴한다. |
static oracle.sql.CLOB |
getCLOB(Connection con,
String str)
문자열 데이터로 부터 CLOB(Character Large OBject) 객체를 생성하여 리턴한다. |
static String |
getString(oracle.xdb.XMLType xml)
XMLType 객체의 내용을 문자열 데이터로 변환하여 리턴하는 메소드. |
static String |
getStringForCLOB(oracle.sql.CLOB clob)
CLOB 객체의 내용을 문자열 데이터로 변환하여 리턴하는 메소드. |
static oracle.xdb.XMLType |
getXMLType(Connection con,
String str)
문자열 데이터로 부터 XMLType 객체를 생성하여 리턴한다. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OracleTypeHelper()
| Method Detail |
|---|
public static oracle.sql.CLOB getCLOB(Connection con,
char[] str)
throws SQLException
문자열 데이터로 부터 CLOB(Character Large OBject) 객체를 생성하여 리턴한다.
파라미터로 받은 Connection 으로 부터 물리적인 Connection 정보를 얻어 이를 기반으로
CLOB 객체를 생성하여 리턴한다. 다음은 사용예이다.
import oracle.sql.CLOB;
import java.sql.Connection;
import kr.co.hit.live.dao.SQLMapsDAO;
class MyDao extends SQLMapsDAO{
Connection con = this.getCurrentConnection();
char[] str = new char[]{'t','e','s','t'}";
CLOB clob = OracleTypeHelper.getCLOB(con,str);
..
}
con - 실제 물리적 Connection 얻어오기 위한 해당 애플리케이션의 Connection 정보str - CLOB 객체로 변환될 문자열 데이터
LiveException - CLOB 객체의 생성이 실패하거나, CLOB 객체 생성시 활용했던 리소스의 해제가
정상적으로 이루어지지 않은 경우
SQLException
public static oracle.sql.CLOB getCLOB(Connection con,
String str)
throws SQLException
문자열 데이터로 부터 CLOB(Character Large OBject) 객체를 생성하여 리턴한다.
파라미터로 받은 Connection 으로 부터 물리적인 Connection 정보를 얻어 이를 기반으로
CLOB 객체를 생성하여 리턴한다. 다음은 사용예이다.
import oracle.sql.CLOB;
import java.sql.Connection;
import kr.co.hit.live.dao.SQLMapsDAO;
class MyDao extends SQLMapsDAO{
Connection con = this.getCurrentConnection();
String str = "test";
CLOB clob = OracleTypeHelper.getCLOB(con,str);
..
}
con - 실제 물리적 Connection 얻어오기 위한 해당 애플리케이션의 Connection 정보str - CLOB 객체로 변환될 문자열 데이터
LiveException - CLOB 객체의 생성이 실패하거나, CLOB 객체 생성시 활용했던 리소스의 해제가
정상적으로 이루어지지 않은 경우
SQLException
public static oracle.sql.BLOB getBLOB(Connection con,
byte[] bytes)
throws SQLException
바이트 배열 데이터로 부터 BLOB(Binary Large OBject) 객체를 생성하여 리턴한다.
파라미터로 받은 Connection 으로 부터 물리적인 Connection 정보를 얻어 이를 기반으로
BLOB 객체를 생성하여 리턴한다.
con - 실제 물리적 Connection 얻어오기 위한 해당 애플리케이션의 Connection 정보bytes - BLOB 객체로 변환될 바이트 배열 데이터
LiveException - BLOB 객체의 생성이 실패하거나, BLOB 객체 생성시 활용했던 리소스의 해제가
정상적으로 이루어지지 않은 경우
SQLException
public static oracle.xdb.XMLType getXMLType(Connection con,
String str)
throws SQLException
문자열 데이터로 부터 XMLType 객체를 생성하여 리턴한다.
파라미터로 받은 Connection 으로 부터 물리적인 Connection 정보를 얻어 이를 기반으로
XMLType 객체를 생성하여 리턴한다.
con - 실제 물리적 Connection 얻어오기 위한 해당 애플리케이션의 Connection 정보str - XMLType 객체로 변환될 문자열 데이터
LiveException - XMLType 객체의 생성이 실패하거나, XMLType 객체 생성시 활용했던 리소스의 해제가
정상적으로 이루어지지 않은 경우
SQLException
public static String getStringForCLOB(oracle.sql.CLOB clob)
throws SQLException
CLOB 객체의 내용을 문자열 데이터로 변환하여 리턴하는 메소드.
clob - 문자열로 변환될 CLOB 객체
LiveException - CLOB 객체에서 문자열 정보를 추출할 때 에러가 발생하는 경우
SQLException
public static String getString(oracle.xdb.XMLType xml)
throws SQLException
XMLType 객체의 내용을 문자열 데이터로 변환하여 리턴하는 메소드.
xml - 문자열로 변환될 XMLType 객체
LiveException - XMLType 객체에서 문자열 정보를 추출할 때 에러가 발생하는 경우
SQLException
public static byte[] getBytes(oracle.sql.BLOB blob)
throws SQLException
BLOB 객체의 내용을 바이트 배열로 변환하여 리턴하는 메소드.
blob - 바이트 배열로 변환될 BLOB 객체
SQLException
public static oracle.sql.ARRAY getARRAY(Connection con,
String typeName,
Object obj)
throws SQLException
con - typeName - obj -
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||