I am working on an application where I would like to store all my current user authentications (users that are currently logged in with their login tokens) in a database in memory. Currently I have an HSQL DB that I do a DROP and CREATE TABLE command onApplicationStart to store the authentications, but I was wondering if their is a way that I could just wipe out the database when the application restarts (currently it is stored until the server restarts).

Is there a way that I could create an in memory database that has limited access from only the application that uses it, and that destroys itself when the application restarts?

Todd's method works the best with a drop in the onApplicationEnd to clear out the database. From what I have seen there is no way, unless I just create an Array of structs to do a fully application dependent database.
–
Dave LongFeb 25 '11 at 3:21

Why don't you just wipe the table in onApplicationStart()? That way you can be sure it's empty when the app starts.
–
Todd SharpFeb 25 '11 at 13:56

@ToddSharp These links are not responding.
–
Tom HubbardOct 9 '12 at 15:36

If I drop the table then it is completely gone, but I was wondering if anyone has any ideas for how I could have the database only stored in memory for as long as the application is alive. I am guess that my only option is to just drop the table on application end.
–
Dave LongFeb 25 '11 at 1:07

If you are wanting that functionality, it may be easier to simply let the data reside in memory and not even worry about the database.
–
rayman86Feb 25 '11 at 1:10

TRUNCATE TABLE <tablename> also works in HSQLDB.
–
fredtFeb 26 '11 at 13:25

This is really a comment, not an answer to the question. Please use "add comment" to leave feedback for the author.
–
Max MacLeodAug 15 '12 at 12:18