Vertica throwing exception for : Multiple SQL Statement Support

I am using Java Vertica jdbc client 7.1.2. When I execute any multi-statement query it fails with exception :
java.sql.SQLDataException: [Vertica]JDBC Exactly one result expected, but 2 results created from query "". Query not executed.

I ran the same query mentioned here.

I tried adding 'allowMultiQueries=true' in jdbc URL, but it didn't work.

Code :
String url = "jdbc:vertica://myIP:5433/db?allowMultiQueries=true";
String sql = "CREATE TABLE t(a INT);INSERT INTO t VALUES(10);";
Properties myProp = new Properties();
myProp.put("user", "user");
myProp.put("password", "pass");
Connection dbConnection = DriverManager.getConnection(url,myProp);
Statement statement = dbConnection.createStatement();
statement.executeUpdate(sql);

Any help would be appreciated.

Answers

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file