±Û¾´ÀÌ :ÀüÀÀ½Ä 1998³â 2¿ù 25ÀÏ 10:43:28
¾È³çÇϽʴϱî?
Àú´Â Áö±Ý °Ô½ÃÆÇÀ» Á¦ÀÛÁßÀε¥,
¹®Á¦°¡ ¹ß»ýÇÏ¿©¼ ÀÌ·¸°Ô Áú¹®À» µå¸³´Ï´Ù.
Àú´Â JDK1.1.4¸¦ »ç¿ëÇÏ°í DB´Â Oracle,
Jdbc-Odbc´Â Oracle¿¡¼ Á¦°øµÇ¾îÁö´Â Thin Driveer¸¦ »ç¿ëÇÏ°í ÀÖ½À´Ï´Ù.
resultsetÀÇ MethodÀÎ getBinaryStreamÀ̳ª getBytes »ç¿ëÇÏ¿© °¡Á®¿Â ÇѱÛÀ»
¾î¶»°Ô ÇÏ¸é »ç¿ëÇÒ¼ö ÀÖ´Â ÇѱÛü°è·Î ¹Ù²Ü¼öÀÖ´ÂÁö°¡ ±Ã±ÝÇÕ´Ï´Ù.
Âü°í·Î Á¦°¡ Á¦ÀÛÇÑ ¼Ò½ºÀÇ ÀϺθ¦ ¿Ã¸®¿À´Ï,
ÀÚ¼¼ÇÑ Áöµµ¸¦ ±â´Ù¸®°Ú½À´Ï´Ù.
while (results.next())
{
for (int i=1; i<=cols; i++)
{
System.out.println("Type = "+String.valueOf(resultsMetaData.getColumnTypeName(i))+", "+
String.valueOf(resultsMetaData.getColumnType(i))+", "+
"Col Name =" +resultsMetaData.getColumnName(i)) ;
if(results.getBytes(i) != null)
{
if(resultsMetaData.getColumnType(i) == 12)
{
int size =0 ;
try
{
java.io.InputStream fin = results.getBinaryStream(i) ;
for(;;)
{
size = fin.read(buff) ;
System.out.println(String.valueOf(size)) ;
if(size == 50) break ;
/* Á¦°¡ ÀÓÀÇ·Î ÀâÀº°ÍÀÓ*/
}
}catch (Exception e) System.out.println(String.valueOf(e)) ;
try
{
System.out.println("Bin="+new String(buff, 0, 0, size)) ;
}catch (Exception e) System.out.println(String.valueOf(e) ) ;
}
else
System.out.println("Result"+String.valueOf(i)+"= "+results.getString(i)) ; //getBytes(i)
}
else System.out.println("Result"+String.valueOf(i)+"= Null error") ;
±×¸®°í getStringÀ» »ç¿ëÇÏ¿© DB¿¡ ÀÖ´Â ÇѱÛÀ» °¡Á®¿Ã¶§
-java.sql.SQLException: Fail to convert between UTF8 and UCS2
¶ó´Â Error Message°¡ ¶ß´Âµ¥ ¾î¶»°Ô ÇÏ¸é µÇ°Ú½À´Ï±î?
¿©·¯°í¼öµéÀÇ µµ¿òºÎŹµå¸²´Ï´Ù
.........