Background Image

FORUM

?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

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();
  }
 }

}

  • ?
    이용미 2013.01.23 22:20

    안녕하세요.

    사용에 불편을 드려 죄송합니다.

     

    일단 데이터 결과가 저장되는 변수 "aa"를 이용하여 길이를 구하는 것으로 우회 부탁드립니다.

    예제의 while 부분을 다음과 같이 수정해 주시면 됩니다.

    String aa = rs.getString(1);

    System.out.println(aa);

    int colSize = aa.length();

    System.out.println("ColSize = " + colSize);

     

    해당 문제점을 개발팀에 전달하도록 하겠으며, 되도록 빠른 시간 내에 수정될 수 있도록 하겠습니다.


  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views116
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4474
    read more
  3. 컬럼 종류

    Date2013.02.14 By소라게 Views6184
    Read More
  4. 컬럼 코멘트 관련해 문의 드립니다.

    Date2020.08.12 By워리파파 Views1034
    Read More
  5. 컬럼 코멘트 입력

    Date2019.12.09 By그리피 Views2573
    Read More
  6. 컬럼명 한글 및 csv 읽어서 연동

    Date2020.02.17 Byintern1910 Views473
    Read More
  7. 컬럼명을 한글로 하였을 경우 쿼리 속도에 영향을 받을 수 있을까요?

    Date2009.04.07 Byspowner Views18015
    Read More
  8. 컬럼상 콤마 삭제 질문드립니다.

    Date2021.03.19 By테스형2 Views245
    Read More
  9. 컬럼설명 편집/검색 기능

    Date2014.08.19 Bymoon Views8651
    Read More
  10. 컬럼의 Enum DataType 가져오는것 문의

    Date2024.01.30 By엘L Views75
    Read More
  11. 컬럼의 dafualt 설정에 함수 쓰면 안되나요?

    Date2017.08.30 By덴드로비움 Views171
    Read More
  12. 컬럼의 길이를 잘못 가져옵니다. rs.getMetaData.getColumnDisplaySize(1);

    Date2013.01.22 By검풍이 Views9953
    Read More
  13. 컴이 느려집니다.

    Date2013.02.10 By또랑 Views22068
    Read More
  14. 컴파일 할 때 오류 cannot find -lcurses

    Date2009.10.08 By아주가끔은 Views12173
    Read More
  15. 컴파일시 에러가 발생합니다...

    Date2010.11.08 BySoMa Views17481
    Read More
  16. 컴포지션 관련해서 문의 드립니다.

    Date2010.02.12 By野花 Views12033
    Read More
  17. 컴퓨터 메모리 증가 현상 문의드립니다

    Date2012.09.23 By파파후드 Views10834
    Read More
  18. 컴퓨터 부팅 시 Unable to register the CUBRID Service Tray.Retry? 메세지 문의

    Date2013.03.04 Byconomia Views10291
    Read More
  19. 컴퓨터 부팅 시 Unable to register the CUBRID Service Tray.Retry? 메세지 문의

    Date2014.10.08 By나이젤 Views7422
    Read More
  20. 컴퓨터 이름 바꾼후 데이터베이스가 안보여요.

    Date2014.07.08 By그러게 Views2
    Read More
  21. 케릭터셋 문제입니다.

    Date2020.04.13 By훈입니다. Views364
    Read More
  22. 코드셋 호환문제

    Date2013.08.07 By잘생긴오빠 Views7376
    Read More
Board Pagination Prev 1 ... 154 155 156 157 158 159 160 161 162 163 ... 200 Next
/ 200

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales