You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Grzegorz Solecki <gs...@gmail.com> on 2019/02/06 17:55:44 UTC

Drill JDBC Prepared Statement not working while Statement is working.

When I run simple example when I create JDBC PreparedStatement:
        Class.forName("com.mapr.drill.jdbc41.Driver");
        Connection con =
DriverManager.getConnection("jdbc:drill:zk=mapr-node-01:5181/drill/mapr-clst-01.jtv.com-drillbits;auth=MAPRSASL");

        PreparedStatement pstmt = con.prepareStatement( "VALUES 11" );
        ResultSet rs = pstmt.executeQuery();
        rs.next();
        System.out.println("Value :: " + rs.getInt(1));

the execution is hanging on execute query line.

However when I run similar example with JDBC Statement everything is
working as expected:
        Class.forName("com.mapr.drill.jdbc41.Driver");
        Connection con =
DriverManager.getConnection("jdbc:drill:zk=mapr-node-01:5181/drill/mapr-clst-01.jtv.com-drillbits;auth=MAPRSASL");

        Statement stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery("VALUES 11");
        rs.next();
        System.out.println("Value :: " + rs.getInt(1));
And I get values listed.

Any ideas what could be a problem?
What could cause the execution hanging when I use PreparedStatement instead
of Statement ?