Skip to content

[jdbc-v2] ResultSet#findColumn always returns 0 #2375

@gravity182

Description

@gravity182

Description

The ResultSet#findColumn method returns 0 for any column.

Steps to reproduce

  1. Obtain ResultSet
  2. Call findColumn for either of the columns' labels.

Expected Behaviour

The method should return an actual column's index.

Code Example

Let's assume it's the flow inside some jdbc result mapper:

ResultSet _rs = ...

int _idx_uuid = _rs.findColumn("uuid"); // returns 0
String uuid = _rs.getString(_idx_uuid) // throws NoSuchColumnException

The code above throws NoSuchColumnException since getString expects the index parameter to start from 1. Given that findColumn returns 0, it'll always throw an Exception.

Configuration

Client Configuration

Environment

  • Client version: jdbc-v2-0.8.5
  • Language version: Java 17
  • OS: Windows 10

ClickHouse Server

  • ClickHouse Server version: 25.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions