[정보]오라클 JDBC 한글처리문제


[ Follow Ups ] [ Post Followup ] [ 자바 묻고 답하기 ]

Posted by 백승용 on October 01, 1997 at 17:19:13:

In Reply to: [질문]오라클 JDBC한글 문제처리 좀? posted by 조태훈 on September 30, 1997 at 19:10:31:

먼저 DB에 저장
다음 메소드를 이용하십시요!
static public String ksc2asc(String str)
{
String result = null;
try {
byte[] rawBytes = str.getBytes("KSC5601");
result = new String(rawBytes, "8859_1");
}
catch (java.io.UnsupportedEncodingException e) {
System.err.println(e.toString());
}
return result;
}



다음에 DB에서 읽은 한글을 TextField나 TextArea에
보여줄때...
static public String asc2ksc(String str)
{
String result = null;
try {
byte[] rawBytes = str.getBytes("8859_1");
result = new String(rawBytes, "KSC5601");
}
catch (java.io.UnsupportedEncodingException e) {
System.err.println(e.toString());
}
return result;
}



많은 참조가 되길......


Follow Ups:



이어서 글올리기(답하기)

이름:
E-Mail:
제목:
내용:
관련 URL(선택):
URL 제목(선택):
관련 이미지 URL:


[ Follow Ups ] [ Post Followup ] [ 자바 묻고 답하기 ]