import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Deleteme {
public static void main(String[] args) throws Exception {
Class.forName("org.hsqldb.jdbcDriver");
Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:tt", "sa", "");
Statement s = c.createStatement();
s.execute("create table x (i int)");
s.close();
for (int i=1; i< 100; i++) {
s = c.createStatement();
s.execute("insert into x values (" + i + ")");
s.close();
}
s = c.createStatement();
ResultSet r = s.executeQuery("select * from x");
while(r.next()) {
System.out.println(r.getString(1));
}
}
}
hsqldb memory mode
最新推荐文章于 2021-01-19 20:10:32 发布