100% in-memory HSQL database

我们两清 提交于 2019-12-04 22:16:24

问题


I have a Java application set up as a service to do data-mining against ~3GB of data every few hours. I would like this to occur 100% in memory. Ideally I want the application to be isolated from everything; I want it to construct the database, do the mining I need, and tear down the database when it's done.

However with HSQLDB, even when i use the "create memory table...." command, a log is written of all of the statements and the table is recreated the next time the application runs.

I'm doing a LOT of inserts, ~150k+, so this file will quickly grow in size. I also don't care about reconstructing the database upon next run, so the logging is useless to me.

I could just delete the file when I'm done, but if possible I'd like to avoid having to write that much to the disk.

Is there a way to turn off this feature?

Thanks in advance!


回答1:


No problem, just open the database connection thus:

 Connection c = DriverManager.getConnection("jdbc:hsqldb:mem:aname", "sa", "");

For more information, refer to the HSQL docs.



来源:https://stackoverflow.com/questions/199598/100-in-memory-hsql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!