Forum: Building VoltDB Clients

Post: Query with JDBC driver failing

Query with JDBC driver failing
radamsky
Apr 23, 2012
Am trying to talk to volt using its JDBC client and groovy. Downloaded 2.5 volt. Here is sample of what I am trying:
Sql volt = Sql.newInstance(
"jdbc:voltdb://localhost:21212",
"", "", "org.voltdb.jdbc.Driver")

volt.rows("select my_column from my_table where my_table_id = 1").each() {
println "${it}"
}
When it hits the query, I get an exception:
groovy.sql.Sql$AbstractQueryCommand execute
WARNING: Failed to execute: select my_column from my_table where my_table_id = 1 because: null
Caught: java.sql.SQLFeatureNotSupportedException
java.sql.SQLFeatureNotSupportedException
at org.voltdb.jdbc.SQLError.noSupport(SQLError.java:65)
at org.voltdb.jdbc.JDBC4Connection.createStatement(JDBC4Connection.java:155)
In previous code, I have seeded this table with records including the one I am querrying for above.
Using the 'volt java client' works; only fails when using JDBC as above.
Hi, Would you mind trying
scooper
Apr 23, 2012
Hi,
Would you mind trying your example with straight Java and JDBC, not Groovy? It would be interesting if you get different behavior under Groovy vs. Java/JDBC.
The next release of the JDBC driver will provide better error reporting, which might help.
Cheers,
Steve
Test results groovy vs java
radamsky
Apr 25, 2012
Hi,
Would you mind trying your example with straight Java and JDBC, not Groovy? It would be interesting if you get different behavior under Groovy vs. Java/JDBC.
The next release of the JDBC driver will provide better error reporting, which might help.
Cheers,
Steve


Running with JDBC java.sql.Connection directly works in both Groovy and Java when invoking createStatement().
The problem seems centered around which createStatement(...) is called by Groovy. Does the VoltDB connection support all Connection.createStatement methods = specifically those that pass resultSetType and resultSetConcurrency? When I try those, using java.sql.Connection, it failed for both Java and Groovy.
Here is example that fails in either Groovy or Java:
Statement st = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
createStatement limitations
scooper
Apr 25, 2012
Running with JDBC java.sql.Connection directly works in both Groovy and Java when invoking createStatement().
The problem seems centered around which createStatement(...) is called by Groovy. Does the VoltDB connection support all Connection.createStatement methods = specifically those that pass resultSetType and resultSetConcurrency? When I try those, using java.sql.Connection, it failed for both Java and Groovy.
Here is example that fails in either Groovy or Java:
Statement st = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);


Thanks for the additional details.
Sorry, but for now we only support ResultSet.TYPE_SCROLL_INSENSITIVE and ResultSet.CONCUR_READ_ONLY as arguments to this version of createStatement(). Any other values will fail.
I'll add a ticket to make sure we look at clarifying or addressing these limitations.
Ticket #: ENG-2883
Steve