You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Jerome Haltom <jh...@alethic.solutions> on 2026/02/16 15:30:07 UTC
JDBC Driver, parseStmtList?
I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
Re: JDBC Driver, parseStmtList?
Posted by Julian Hyde <jh...@gmail.com>.
Jerome,
Can you log a feature request in Jira? As you noted, support is already there in the parser. But your request is for the JDBC driver. Your description should provide a JDBC fragment that illustrates the new API calls. Also describe the JDBC option that we would add to enable this functionality.
You should link to https://issues.apache.org/jira/browse/CALCITE-2453, the case that added parser support.
Julian
> On Feb 17, 2026, at 2:15 PM, Jerome Haltom <jh...@alethic.solutions> wrote:
>
> MS SQL simply accepts ';' as a statement delimiter. Each ResultSet that is returned is available on getNextResult().
>
> Same with MySQL, though they require you to pass allowMultipleQueries=true as an option.
>
> Snowflake is like MS SQL: https://docs.snowflake.com/en/developer-guide/jdbc/jdbc-using#multi-statement-jdbc
>
> There are numerous other JDBC drivers like this. It may or may not be allowed by the specification, but the number of drivers that use THAT as an excuse is pretty minimal. The ones I've found that don't use 'sql injection' as the reason. Which may have been a good reason initially, but I think was pretty much solved with 'don't use non parameterized queries' instead.
>
> If Calcite wants to say "the specification does not allow us to" despite all these other drivers allowing you to, fine. That's fine. But that's exactly the type of thing I was searching for by opening this question.
>
> ________________________________
> From: Julian Hyde <jh...@gmail.com>
> Sent: Tuesday, February 17, 2026 16:07
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: JDBC Driver, parseStmtList?
>
> Jerome,
>
> Are you claiming that parseStmtList is part of the JDBC API? How do you achieve this effect with other drivers? Do they return a list of PreparedStatement objects or something like that? Do they use semicolon as delimiter? (I don’t recall anything in the SQL or JDBC standards specifying a delimiter.)
>
> Julian
>
>> On Feb 17, 2026, at 08:52, Mihai Budiu <mb...@gmail.com> wrote:
>>
>> According to one AI agent, multi-statement JDBC support is actually not a standard feature, and is only supported by some drivers.
>>
>> If there is a spec that makes sense, I guess Calcite could support it. Calcite supports many non-standard features.
>>
>> Mihai
>> ________________________________
>> From: Jerome Haltom <jh...@alethic.solutions>
>> Sent: Tuesday, February 17, 2026 8:45 AM
>> To: dev@calcite.apache.org <de...@calcite.apache.org>
>> Subject: Re: JDBC Driver, parseStmtList?
>>
>> I mean, if you run a statement like "select 1; select 1" it fails. It does not support multiple SQL statements per individual JDBC call. Most other drivers do.
>>
>> I would consider an implementation. But my question was more like "this is how it is, is there a reason, historical or not?" If there's no reason, and it's a thing the Calcite project would want, I would consider implementing it.
>>
>>
>> ________________________________
>> From: Mihai Budiu <mb...@gmail.com>
>> Sent: Tuesday, February 17, 2026 10:41
>> To: dev@calcite.apache.org <de...@calcite.apache.org>
>> Subject: Re: JDBC Driver, parseStmtList?
>>
>> I have not used Calcite through the JDBC driver in this way.
>>
>> Can you provide a reproduction of the issue you are seeing?
>>
>> If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
>>
>> Mihai
>> ________________________________
>> From: Jerome Haltom <jh...@alethic.solutions>
>> Sent: Monday, February 16, 2026 7:30 AM
>> To: dev@calcite.apache.org <de...@calcite.apache.org>
>> Subject: JDBC Driver, parseStmtList?
>>
>> I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
>>
>> I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
>>
Re: JDBC Driver, parseStmtList?
Posted by Jerome Haltom <jh...@alethic.solutions>.
MS SQL simply accepts ';' as a statement delimiter. Each ResultSet that is returned is available on getNextResult().
Same with MySQL, though they require you to pass allowMultipleQueries=true as an option.
Snowflake is like MS SQL: https://docs.snowflake.com/en/developer-guide/jdbc/jdbc-using#multi-statement-jdbc
There are numerous other JDBC drivers like this. It may or may not be allowed by the specification, but the number of drivers that use THAT as an excuse is pretty minimal. The ones I've found that don't use 'sql injection' as the reason. Which may have been a good reason initially, but I think was pretty much solved with 'don't use non parameterized queries' instead.
If Calcite wants to say "the specification does not allow us to" despite all these other drivers allowing you to, fine. That's fine. But that's exactly the type of thing I was searching for by opening this question.
________________________________
From: Julian Hyde <jh...@gmail.com>
Sent: Tuesday, February 17, 2026 16:07
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: JDBC Driver, parseStmtList?
Jerome,
Are you claiming that parseStmtList is part of the JDBC API? How do you achieve this effect with other drivers? Do they return a list of PreparedStatement objects or something like that? Do they use semicolon as delimiter? (I don’t recall anything in the SQL or JDBC standards specifying a delimiter.)
Julian
> On Feb 17, 2026, at 08:52, Mihai Budiu <mb...@gmail.com> wrote:
>
> According to one AI agent, multi-statement JDBC support is actually not a standard feature, and is only supported by some drivers.
>
> If there is a spec that makes sense, I guess Calcite could support it. Calcite supports many non-standard features.
>
> Mihai
> ________________________________
> From: Jerome Haltom <jh...@alethic.solutions>
> Sent: Tuesday, February 17, 2026 8:45 AM
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: JDBC Driver, parseStmtList?
>
> I mean, if you run a statement like "select 1; select 1" it fails. It does not support multiple SQL statements per individual JDBC call. Most other drivers do.
>
> I would consider an implementation. But my question was more like "this is how it is, is there a reason, historical or not?" If there's no reason, and it's a thing the Calcite project would want, I would consider implementing it.
>
>
> ________________________________
> From: Mihai Budiu <mb...@gmail.com>
> Sent: Tuesday, February 17, 2026 10:41
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: JDBC Driver, parseStmtList?
>
> I have not used Calcite through the JDBC driver in this way.
>
> Can you provide a reproduction of the issue you are seeing?
>
> If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
>
> Mihai
> ________________________________
> From: Jerome Haltom <jh...@alethic.solutions>
> Sent: Monday, February 16, 2026 7:30 AM
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: JDBC Driver, parseStmtList?
>
> I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
>
> I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
>
Re: JDBC Driver, parseStmtList?
Posted by Julian Hyde <jh...@gmail.com>.
Jerome,
Are you claiming that parseStmtList is part of the JDBC API? How do you achieve this effect with other drivers? Do they return a list of PreparedStatement objects or something like that? Do they use semicolon as delimiter? (I don’t recall anything in the SQL or JDBC standards specifying a delimiter.)
Julian
> On Feb 17, 2026, at 08:52, Mihai Budiu <mb...@gmail.com> wrote:
>
> According to one AI agent, multi-statement JDBC support is actually not a standard feature, and is only supported by some drivers.
>
> If there is a spec that makes sense, I guess Calcite could support it. Calcite supports many non-standard features.
>
> Mihai
> ________________________________
> From: Jerome Haltom <jh...@alethic.solutions>
> Sent: Tuesday, February 17, 2026 8:45 AM
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: JDBC Driver, parseStmtList?
>
> I mean, if you run a statement like "select 1; select 1" it fails. It does not support multiple SQL statements per individual JDBC call. Most other drivers do.
>
> I would consider an implementation. But my question was more like "this is how it is, is there a reason, historical or not?" If there's no reason, and it's a thing the Calcite project would want, I would consider implementing it.
>
>
> ________________________________
> From: Mihai Budiu <mb...@gmail.com>
> Sent: Tuesday, February 17, 2026 10:41
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: Re: JDBC Driver, parseStmtList?
>
> I have not used Calcite through the JDBC driver in this way.
>
> Can you provide a reproduction of the issue you are seeing?
>
> If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
>
> Mihai
> ________________________________
> From: Jerome Haltom <jh...@alethic.solutions>
> Sent: Monday, February 16, 2026 7:30 AM
> To: dev@calcite.apache.org <de...@calcite.apache.org>
> Subject: JDBC Driver, parseStmtList?
>
> I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
>
> I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
>
Re: JDBC Driver, parseStmtList?
Posted by Mihai Budiu <mb...@gmail.com>.
According to one AI agent, multi-statement JDBC support is actually not a standard feature, and is only supported by some drivers.
If there is a spec that makes sense, I guess Calcite could support it. Calcite supports many non-standard features.
Mihai
________________________________
From: Jerome Haltom <jh...@alethic.solutions>
Sent: Tuesday, February 17, 2026 8:45 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: JDBC Driver, parseStmtList?
I mean, if you run a statement like "select 1; select 1" it fails. It does not support multiple SQL statements per individual JDBC call. Most other drivers do.
I would consider an implementation. But my question was more like "this is how it is, is there a reason, historical or not?" If there's no reason, and it's a thing the Calcite project would want, I would consider implementing it.
________________________________
From: Mihai Budiu <mb...@gmail.com>
Sent: Tuesday, February 17, 2026 10:41
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: JDBC Driver, parseStmtList?
I have not used Calcite through the JDBC driver in this way.
Can you provide a reproduction of the issue you are seeing?
If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
Mihai
________________________________
From: Jerome Haltom <jh...@alethic.solutions>
Sent: Monday, February 16, 2026 7:30 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: JDBC Driver, parseStmtList?
I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
Re: JDBC Driver, parseStmtList?
Posted by Jerome Haltom <jh...@alethic.solutions>.
I mean, if you run a statement like "select 1; select 1" it fails. It does not support multiple SQL statements per individual JDBC call. Most other drivers do.
I would consider an implementation. But my question was more like "this is how it is, is there a reason, historical or not?" If there's no reason, and it's a thing the Calcite project would want, I would consider implementing it.
________________________________
From: Mihai Budiu <mb...@gmail.com>
Sent: Tuesday, February 17, 2026 10:41
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: Re: JDBC Driver, parseStmtList?
I have not used Calcite through the JDBC driver in this way.
Can you provide a reproduction of the issue you are seeing?
If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
Mihai
________________________________
From: Jerome Haltom <jh...@alethic.solutions>
Sent: Monday, February 16, 2026 7:30 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: JDBC Driver, parseStmtList?
I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?
Re: JDBC Driver, parseStmtList?
Posted by Mihai Budiu <mb...@gmail.com>.
I have not used Calcite through the JDBC driver in this way.
Can you provide a reproduction of the issue you are seeing?
If this is a missing feature, you should consider filing a JIRA issue, and perhaps contributing an implementation? https://issues.apache.org/jira/projects/CALCITE
Mihai
________________________________
From: Jerome Haltom <jh...@alethic.solutions>
Sent: Monday, February 16, 2026 7:30 AM
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject: JDBC Driver, parseStmtList?
I am working on an application that makes use of Calcite through the JDBC driver, and am hitting a problem with it being unable to parse multiple semi-colon separated statements. My investigations tell me this isn't supported. parseStmt is invoked on the parser, not parseStmtList. And of course the rest of it isn't built to deal with multiple statements, tracking multiple resultsets, etc.
I guess my first question would be, why? Is there a reason for this as it stands, or is it just that nobody has gone through an added support for multiple statements since that was added?