Skip to content

[APIS-1098] Implement the JDBC Wrapper interface across driver classes - #84

Merged
Srltas merged 3 commits into
CUBRID:developfrom
Srltas:APIS-1098
Aug 18, 2026
Merged

[APIS-1098] Implement the JDBC Wrapper interface across driver classes#84
Srltas merged 3 commits into
CUBRID:developfrom
Srltas:APIS-1098

Conversation

@Srltas

@Srltas Srltas commented Aug 5, 2026

Copy link
Copy Markdown
Member

http://jira.cubrid.org/browse/APIS-1098

Purpose

CUBRID JDBC의 고유 API(getQueryplan, setLockTimeout 등)는 CUBRIDConnection 등으로 캐스팅해야 사용할 수 있습니다. HikariCP 같은 풀은 커넥션을 프록시로 감싸서 돌려주므로 직접 캐시팅하면 ClassCastException이 발생합니다. JDBC 4.0의 java.sql.Wrapper가 이 문제를 해결해주는 API로, 두 메서드를 구현해 CUBRID 고유 API에 접근할 수 있도록 합니다.

Implementation

Wrapper 직접 구현 7개 클래스.

호출 결과
자기 타입 / 구현 인터페이스 unwrap 자신 반환, isWrapperFor true
무관한 타입 unwrap SQLException(-21120), isWrapperFor false
null 둘 다 NullPointerException (별도 null 검사 없음)
닫힌 객체 각 클래스의 기존 closed 예외
  • null은 주요 드라이버 5개(pgjdbc, MySQL, Oracle, MariaDB, MSSQL)이 모두 가드 없이 NPE를 던져 동일하게 맞췄습니다.
  • 예외 메시지는 CUBRIDException의 static 헬퍼 cannotUnwrapMessage로 통일했습니다.

Remarks

@Srltas Srltas self-assigned this Aug 5, 2026
Comment on lines +85 to +88
col_schema[i] =
dotIndex != -1
? tableName.substring(0, dotIndex).toUpperCase(Locale.ENGLISH)
: "";

@Srltas Srltas Aug 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

포맷터를 돌리면 자동 수정되는 부분으로, 이번 PR과 무관한 변경입니다.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "fix: reject a null type in isWrapperFor ..." | Re-trigger Greptile

Comment thread src/jdbc/cubrid/jdbc/driver/CUBRIDConnection.java
@Srltas
Srltas requested a review from hwany7seo August 5, 2026 23:05
Comment thread src/jdbc/cubrid/jdbc/driver/CUBRIDConnection.java Outdated
Comment thread src/jdbc/cubrid/jdbc/driver/CUBRIDConnection.java Outdated
@Srltas
Srltas merged commit 51152ed into CUBRID:develop Aug 18, 2026
3 checks passed
@Srltas
Srltas deleted the APIS-1098 branch August 18, 2026 04:36
Srltas pushed a commit to CUBRID/cubrid that referenced this pull request Aug 18, 2026
2a9ca81 -> 51152ed (1 commit(s))
CUBRID/cubrid-jdbc@2a9ca81...51152ed

- [APIS-1098] Implement the JDBC Wrapper interface across driver classes (CUBRID/cubrid-jdbc#84)
  http://jira.cubrid.org/browse/APIS-1098

Co-authored-by: cubrid-submodule-bot[bot] <304658916+cubrid-submodule-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants