[
https://issues.apache.org/jira/browse/DRILL-3566?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14652405#comment-14652405
]
ASF GitHub Bot commented on DRILL-3566:
---------------------------------------
GitHub user dsbos opened a pull request:
https://github.com/apache/drill/pull/101
DRILL-3566: Fix: PreparedStatement.executeQuery() got ClassCastException
Main:
Restored DrillResultSetImpl(...)'s statement parameter from overly
restrictive DrillStatementImpl to AvaticaStatement and removed caller
cast that was throwing. (Relatedly, adjusted getStatement() and moved
internal casting from statement to connection.)
Added basic test of querying via Prepared Statement.
[PreparedStatementTest]
Added some case test of statement-creation methods. [Connection Test]
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dsbos/incubator-drill bugs/drill-3566
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/101.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #101
----
commit a3b979734b0ead26e3fb903104d9b65f8464b663
Author: dbarclay <[email protected]>
Date: 2015-07-28T02:27:50Z
DRILL-3566: Fix: PreparedStatement.executeQuery() got ClassCastException.
Main:
Restored DrillResultSetImpl(...)'s statement parameter from overly
restrictive DrillStatementImpl to AvaticaStatement and removed caller
cast that was throwing. (Relatedly, adjusted getStatement() and moved
internal casting from statement to connection.)
Added basic test of querying via PreparedStatement. [PreparedStatementTest]
Added some case test of statement-creation methods. [ConnectionTest]
----
> Calling Connection.prepareStatement throws a ClassCastException
> ---------------------------------------------------------------
>
> Key: DRILL-3566
> URL: https://issues.apache.org/jira/browse/DRILL-3566
> Project: Apache Drill
> Issue Type: Bug
> Components: Client - JDBC
> Reporter: Rahul Challapalli
> Assignee: Daniel Barclay (Drill)
> Priority: Blocker
> Fix For: 1.2.0
>
>
> Git Commit # : 65935db8d01b95a7a3107835d7cd5e61220e2f84
> I am hitting the below exception when using Connection.prepareStatement
> without binding any parameters
> {code}
> PreparedStatement stmt = con.prepareStatement(DRILL_SAMPLE_QUERY);
> Exception in thread "main" java.lang.ClassCastException:
> org.apache.drill.jdbc.impl.DrillJdbc41Factory$DrillJdbc41PreparedStatement
> cannot be cast to org.apache.drill.jdbc.impl.DrillStatementImpl
> at
> org.apache.drill.jdbc.impl.DrillJdbc41Factory.newResultSet(DrillJdbc41Factory.java:106)
> at
> org.apache.drill.jdbc.impl.DrillJdbc41Factory.newResultSet(DrillJdbc41Factory.java:1)
> at
> net.hydromatic.avatica.AvaticaConnection.executeQueryInternal(AvaticaConnection.java:397)
> at
> net.hydromatic.avatica.AvaticaPreparedStatement.executeQuery(AvaticaPreparedStatement.java:77)
> at com.incorta.trails.DrillTest.query(DrillTest.java:33)
> at com.incorta.trails.DrillTest.main(DrillTest.java:12)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)