select to_char(sysdate, "yyyymmdd") from db_root;
와 같은 SQL을 사용할 경우
리턴값은 20130122 와 같이 8자리입니다.
하지만 길이는 1073741823 으로 나타나고 있습니다.
큐브리드만 그렇습니다. 확인 바랍니다.
import java.sql.*;
public class CuTest {
/**
* @param args
*/
public static void main(String[] args) throws SQLException{
// TODO Auto-generated method stub
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try
{
Class.forName("cubrid.jdbc.driver.CUBRIDDriver");
conn = DriverManager.getConnection("jdbc:cubrid:localhost:33000:demodb:dba::", "", "");
String sql = "select to_char(sysdate,'yyyymmdd') as aa from db_root";
stmt = conn.createStatement();
rs = stmt.executeQuery(sql);
while(rs.next())
{
String aa = rs.getString(1);
System.out.println(aa);
}
int colSize = rs.getMetaData().getColumnDisplaySize(1);
System.out.println("ColSize = " + colSize);
rs.close();
stmt.close();
conn.close();
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
안녕하세요.
사용에 불편을 드려 죄송합니다.
일단 데이터 결과가 저장되는 변수 "aa"를 이용하여 길이를 구하는 것으로 우회 부탁드립니다.
예제의 while 부분을 다음과 같이 수정해 주시면 됩니다.
String aa = rs.getString(1);
System.out.println(aa);
int colSize = aa.length();
System.out.println("ColSize = " + colSize);
해당 문제점을 개발팀에 전달하도록 하겠으며, 되도록 빠른 시간 내에 수정될 수 있도록 하겠습니다.