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

Cant retrieve multiple result sets from PreparedStatement.execute() #1062

Closed
urosjarc opened this issue Feb 4, 2024 · 6 comments
Closed

Comments

@urosjarc
Copy link

urosjarc commented Feb 4, 2024

Describe the bug

If I run multiple queries per prepared statement...

val sql = """
    select * from Table1;
    select * from Table2;
    select * from Table3;
"""

And try to retrieve first 2 results I get only first result set per prepared statement.
PS: This code works on postgresql driver and mariadb driver...

ps = conn.prepareStatement(sql)
var isResultSet = ps.execute()

var count = 0
do {
    if (isResultSet) {
        rs = ps.resultSet
        returned.add(decodeResultSet(count, rs)) // decodeResultSet extracts informations from result set to objects
        rs.close()
    } else {
        if (ps.updateCount == -1) break
    } //If there is no more result finish

    count++
    isResultSet = ps.moreResults //Get next result
} while (isResultSet)

return returned

Expected behavior

The result set should get more results not only 1.

Environment (please complete the following information):

  • OS: linux ubuntu
  • CPU architecture: 64bit
  • sqlite-jdbc version 3.44.1.0
@urosjarc urosjarc added the triage label Feb 4, 2024
@gotson
Copy link
Collaborator

gotson commented Feb 5, 2024

Yes, this is a known limitation.

@gotson
Copy link
Collaborator

gotson commented Feb 5, 2024

Duplicate of #277

@gotson gotson marked this as a duplicate of #277 Feb 5, 2024
@gotson gotson closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
@gotson gotson added duplicate and removed triage labels Feb 5, 2024
@urosjarc
Copy link
Author

urosjarc commented Feb 5, 2024

Can you elaborate about this issue, I would really like to know more because I'm producing db library supporting
many of known JDBC supported databases and some drivers have supported this, some not...

I would be more than happy if you provide some links related to this for further reading.

@gotson
Copy link
Collaborator

gotson commented Feb 5, 2024

did you read #277 ? it has all the info

@urosjarc
Copy link
Author

urosjarc commented Feb 5, 2024

Yes I did... But I wonder if there is more informations related to this?

@gotson
Copy link
Collaborator

gotson commented Feb 5, 2024

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants