我需要使用 java 和 HSQL 创建一个独立的数据库应用程序,应用程序的构造函数创建数据库和 2 个表。我写了以下内容:
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();
运行应用程序后,只执行了第一条语句并创建了一个表,没有任何 SQL 异常。任何帮助.............最好的