jdbc - multiple tables creation at runtime -


i need create standalone database app using java , hsql, constructor of app creates database , 2 tables.i wrote following:

        connection connection =drivermanager.getconnection(         jdbc:hsqldb:file:d:\\prod  \\prod,"sa","");         statement statement1=connection.createstatement(         resultset.type_scroll_insensitive,         resultset.concur_read_only);         statement1.executequery(query1);         statement1.close();         statement statement2=connection.createstatement(         resultset.type_scroll_insensitive,resultset.concur_read_only);          statement2.executequery(query2);         statement2.close();         connection.close(); 

aftre running application, first statement has been executed , 1 table has been created without sql exceptions. help.............best ergards

you shouldn't use executequery(text) create table , other data definition statements.

use executeupdate(text) instead.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -