2
我想在內存中存儲我的數據使用sqlite的:如何在內存
這裏是我現在所擁有的
//sq lite driver
Class.forName("org.sqlite.JDBC");
//database path, if it's new data base it will be created in project folder
con = DriverManager.getConnection("jdbc:sqlite:mydb.db");
Statement stat = con.createStatement();
stat.executeUpdate("drop table if exists weights");
//creating table
stat.executeUpdate("create table weights(id integer,"
+ "firstName varchar(30)," + "age INT," + "sex varchar(15),"
+ "weight INT," + "height INT,"
+ "idealweight INT, primary key (id));");
現在我應該在哪裏把這個語句[「:記憶:」 ]將我的這些數據存儲在內存中,數據應該保存,直到我刪除它。
感謝