liutaohua commented on a change in pull request #3181:
URL: https://github.com/apache/iotdb/pull/3181#discussion_r631734838
##########
File path: jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBStatement.java
##########
@@ -581,18 +590,21 @@ public void setMaxFieldSize(int arg0) throws SQLException
{
@Override
public int getMaxRows() throws SQLException {
- throw new SQLException("Not support getMaxRows");
+ return this.maxRows;
}
@Override
public void setMaxRows(int num) throws SQLException {
- throw new SQLException(
- "Not support getMaxRows" + ". Please use the LIMIT clause in a query
instead.");
+ checkConnection("setMaxRows");
+ if (num <= 0) {
+ throw new SQLException(String.format("maxRows %d must be > 0!", num));
+ }
+ this.maxRows = num;
}
@Override
public boolean getMoreResults() throws SQLException {
- throw new SQLException("Not support getMoreResults");
+ return false;
Review comment:
When a statement executes multiple `SELECT`s, 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`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]