Recommendation For A Java In Memory Database
Solution 1:
How about H2 Database? It's pure Java, in-memory and can be embedded into your application, see Connecting to an Embedded (Local) Database
example:
import org.h2.jdbcx.JdbcDataSource;
JdbcDataSourceds=newJdbcDataSource();
ds.setURL("jdbc:h2:˜/test.db");
ds.setUser("sa");
ds.setPassword("sa");
Connectionconn= ds.getConnection();
(adapted from http://www.h2database.com/javadoc/org/h2/jdbcx/JdbcDataSource.html)
If you want an in-memory database, change URL to something like jdbc:h2:mem:test.db or similar. Look for "in-memory Databases" in documentation.
Solution 2:
I have not yet used it, but have a look at JasDB
From the website.
Quick Install guide
JasDB is incredibly easy to get started with it is up and running under a minute simply download and run it, or simply include it in your project Instructions
- Install JasDB by unzipping the download
- Start the database using start.bat or start.sh
- Open http://localhost:7050
From https://github.com/oberasoftware/jasdb/wiki/Using-In-memory-indexes-and-storage
JasDB can run with full in memory based indexes and record storage. The following configuration needs to be used in that case:
<Storage><RecordWriterprovider="inmemory"/><!--<RecordWriter provider="transactional"/>--></Storage>
Post a Comment for "Recommendation For A Java In Memory Database"