Background Image

FORUM

조회 수 16359 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

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

PreparedStatement 변수 바인딩 시에 에러가 발생합니다.


sql = "select test_name from test_table where no = :no";

pstmt = conn.prepareStatement(sql);

pstmt.setString(1,"100");

rs = pstmt.executeQuery();

if(rs.next()) {

result = rs.getString(1);

}


이런 소스를 실행하면 아래와 같은 에러가 발생합니다.

cubrid.jdbc.driver.CUBRIDException: Semantic: Query yields no result, so variable 'no' is not set.

여기서 쿼리의 변수명을 "?"로 설정하면 잘 실행이 됩니다.

sql = "select test_name from test_table where no = ?";


이렇게하면 문제 없이 실행이 되거든요.


왜 변수 지정이 콜론 형식이면 안 되는지 궁금하네요.


  • ?
    이용미 2012.08.07 00:35

    안녕하세요. 질문 감사 드립니다.

    CUBRID에서는 콜론을 사용한 바인딩을 아직 지원하고 있지 않습니다.

    그러나 보편적으로 변수 바인딩 시에 “?” 기호를 사용하고 있으며, My-sql, Ms-sql 또한 동일합니다.


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

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

    Date2020.04.09 Byadmin Views4476
    read more
  3. 표준프레임워크의 공통컴포넌트에 게시판설치관련

    Date2012.08.31 By큐브리 Views22768
    Read More
  4. cubrid ha 백업 문의

    Date2012.08.30 By깽즈야 Views5959
    Read More
  5. cubrid manager 접속 오류와 관련하여

    Date2012.08.30 Bybizsp Views5766
    Read More
  6. loaddb시 피시 메모리 증가와 스왑에 따른 종료문제

    Date2012.08.28 By천상하늘 Views11391
    Read More
  7. DB링크 사용이 가능한지 문의드립니다.

    Date2012.08.28 By장경수 Views5
    Read More
  8. 이전에 질문드렸었는데요.. 중복 제거 쿼리문 재질문드립니다...

    Date2012.08.25 By광황제 Views9117
    Read More
  9. cubrid_real_escape_string 값이 빈 값으로 리턴 됨

    Date2012.08.25 By차오이 Views5547
    Read More
  10. 큐브리드 매니저 비밀번호 오류메시지

    Date2012.08.24 By종이 Views6075
    Read More
  11. 큐브리드 디비 loaddb 시 에러 다시 문의 드립니다.

    Date2012.08.24 By천상하늘 Views8786
    Read More
  12. 스프링의 GeneratedKeyHolder를 쓸수 있나요?

    Date2012.08.24 By안지민 Views8917
    Read More
  13. cubrid_master 프로세스가 사용하는 1523포트에 대해서

    Date2012.08.23 ByDiaBlue Views8753
    Read More
  14. single_byte_compare 설정 및 호스팅 서비스 질문

    Date2012.08.22 By리오 Views6491
    Read More
  15. 큐브리드매니저.. sql파일 열기가 안되는거 맞나요?

    Date2012.08.20 By안지민 Views8016
    Read More
  16. CCI API로 DB Insert 구현 시 JDBC 구현에 비해 속도가 떨어지는 문제

    Date2012.08.17 Bynimbus89 Views7964
    Read More
  17. cubrid ha 구성시에 master node에서 csql 접속 문제

    Date2012.08.17 By깽즈야 Views6320
    Read More
  18. cubrid 백업 문의

    Date2012.08.17 By깽즈야 Views7204
    Read More
  19. 데이터베이스 암호화에 대한 질문

    Date2012.08.14 By유니콘 Views8731
    Read More
  20. 큐브리드 함수 문의

    Date2012.08.10 By아름다운음악 Views12779
    Read More
  21. cubrid addvoldb 명령어 사용

    Date2012.08.08 By깽즈야 Views7981
    Read More
  22. java PreparedStatement 변수 바인딩 시 에러

    Date2012.08.04 By빛돌 Views16359
    Read More
Board Pagination Prev 1 ... 133 134 135 136 137 138 139 140 141 142 ... 201 Next
/ 201

Contact Cubrid

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