balteo
balteo

Reputation: 24709

Access to an embedded in-memory HSQLDB instance

My question relates to in-memory embedded HSQLDB. Say I have one database instance called my_db.

I assume the following code allows to access the above database instance:

org.hsqldb.util.DatabaseManagerSwing.main(new String[] { "--url", "jdbc:hsqldb:mem:my_db", "--noexit" });

Upvotes: 0

Views: 241

Answers (1)

fredt
fredt

Reputation: 24382

Q: Can I access the database from wherever I want provided it is in the same JVM process?

A: Yes you can.

Q: In which specific part of the memory is the data held?

A: In the memory heap of the JVM process

Q: More generally, what rules and restrictions determine from where and how I can access the database instance?

A: The rule is only one JVM process can access a single embedded database. If you need access from more than one JVM, then you need to run an HSQLDB Server instance.

Upvotes: 1

Related Questions