drill-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Solecki <gsolec...@gmail.com>
Subject Drill JDBC Prepared Statement not working while Statement is working.
Date Wed, 06 Feb 2019 17:55:44 GMT
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 ?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message