Implement some JDBC methods to support DataGrip#3181
Merged
qiaojialin merged 3 commits intomasterfrom May 14, 2021
Merged
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
jixuan1989
reviewed
May 13, 2021
| @Override | ||
| public boolean getMoreResults() throws SQLException { | ||
| throw new SQLException("Not support getMoreResults"); | ||
| return false; |
Member
There was a problem hiding this comment.
sounds incorrect...
getMoreResults should return false either:
- the number of fetched rows >= maxRows
- no more results from resultSet.
Contributor
Author
There was a problem hiding this comment.
When a statement executes multiple SELECTs, the result returned becomes a result with multiple results.
getMoreResults are used to obtain the next result set in this case.
ResultSet resultSet = preparedStatement.executeQuery("select * from root.group_9.d_9 slimit 10;select * from root.group_8.d_8 slimit 10;");
I tested whether the server supports multiple SELECT execution at the same time, and I got this error:
org.apache.iotdb.jdbc.IoTDBSQLException: 401: Error occurred while parsing SQL to physical plan: line 1:41 mismatched input 'select' expecting <EOF>
Obviously the server doesn't support it, so here I think it's correct to always return false.
Contributor
There was a problem hiding this comment.
Copied from JDBC javaDoc. I agree with @liutaohua .
boolean getMoreResults()
throws SQLException
Moves to this Statement object's next result, returns true if it is a ResultSet object, and implicitly closes any current ResultSet object(s) obtained with the method getResultSet.
There are no more results when the following is true:
// stmt is a Statement object
((stmt.getMoreResults() == false) && (stmt.getUpdateCount() == -1))
Returns:
true if the next result is a ResultSet object; false if it is an update count or there are no more results
Throws:
SQLException - if a database access error occurs or this method is called on a closed Statement
HTHou
approved these changes
May 14, 2021
qiaojialin
approved these changes
May 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
getMaxRowandgetMoreResultsmethods are used to connect IoTDB usingDataGrip.IoTDB-JDBCis not currently supported.I implemented two methods in which
getMoreResultsare always returning false instead of throwing an exception.It looks OK in my local tests so far.