Cant retrieve multiple result sets from PreparedStatement.execute()
urosjarc opened this issue · 6 comments
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
Yes, this is a known limitation.
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.
Yes I did... But I wonder if there is more informations related to this?
No