Skip to content

#41253 Build CubridDataSource for generic driver connections#41254

Open
Srltas wants to merge 1 commit into
dbeaver:develfrom
Srltas:fix-cubrid-generic-datasource-cast
Open

#41253 Build CubridDataSource for generic driver connections#41254
Srltas wants to merge 1 commit into
dbeaver:develfrom
Srltas:fix-cubrid-generic-datasource-cast

Conversation

@Srltas
Copy link
Copy Markdown
Contributor

@Srltas Srltas commented Jun 6, 2026

Description

Connecting to CUBRID with the generic driver (instead of the bundled CUBRID driver) throws a ClassCastException as soon as you expand the table list:

class org.jkiss.dbeaver.ext.generic.model.GenericDataSource cannot be cast to class 
org.jkiss.dbeaver.ext.cubrid.model.CubridDataSource

CubridMetaModel is picked by driver class match (cubrid.jdbc.driver.CUBRIDDriver), but on the generic provider path the data source is created as a plain GenericDataSource. CubridMetaModel then casts it to CubridDataSource unconditionally, so it fails right when metadata loading starts. The underlying reason is that CubridMetaModel never overrode createDataSourceImpl(), unlike Altibase and most other generic extensions.

Changes

  • Override createDataSourceImpl() in CubridMetaModel so the generic path builds a CubridDataSource as well. This makes the cast safe on both the dedicated and generic provider paths.
  • Remove the now redundant openDataSource() override in CubridDataSourceProvider, since the parent provider already routes through createDataSourceImpl().
  • Keep the metamodel passed into the CubridDataSource constructor instead of allocating a new one.

Fixes #41253

Override createDataSourceImpl() in CubridMetaModel so generic driver connections build a CubridDataSource instead of a GenericDataSource, fixing the ClassCastException when listing tables.
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.

[CUBRID] ClassCastException (GenericDataSource cannot be cast to CubridDataSource) when browsing tables over a generic connection

2 participants