I came around an obstacle . The following statement does not execute because the String query contains multiple statements .
String query="create volatile table test1 as (etc . ); select TOP 10 * from test1; ";
String driver = "com.xxx";
String conUrl="jdbc:ccc";
Class.forName(driver);
Connection conn = DriverManager.getConnection(conUrl,user,password);
PreparedStatement stmt=conn.prepareStatement(query);
The last line throws an error Data definition not valid unless solitary
It is very cumbersome to split my query into multiple PreparedStatements
Is there any other way to execute a query containing multiple statements as one ?
create ...where x='good ; ' and ..." ; select ... ;How can i determine that the first query does not end after the wordgood. i need to write additional complex regex .conn.createStatement().execute(sql)which will sometimes accept multiple statements. But in general, if you use JDBC, you need to know where statements start and end.