Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CassandraResultSet.findColumn() returns a 0 based index (as opposed to 1-based index) #31

Closed
stefanofornari opened this issue Sep 30, 2023 · 0 comments · Fixed by #32
Closed

Comments

@stefanofornari
Copy link
Contributor

Given a simple table like size(id varchar, size bigint), run the following code (with proper connectionstring)

Connection c = DriverManager.getConnection("...", null, null);
Statement s = c.createStatement();
ResultSet rs = s.executeQuery("SELECT \"id\" FROM \"size\" WHERE \"id\" IN ('100')");
System.out.println(rs.findColumn("id"));

Expected behaviour: 1
Current behaviour: 0

As far as I understand from java.sql.ResultSet javadoc, fields in ResultSet are indexed starting from 1, not 0.

maximevw added a commit that referenced this issue Oct 1, 2023
…tSets

- Fix issue #31 complement.
- Return a result even if there's no row in the result set but the column
exist in the statement.
- Fix the exception thrown by the method when the given column name does
not exist in the result set.
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 a pull request may close this issue.

1 participant