How do I share an H2 database over a peer-to-peer

2019-07-15 14:03发布

I've been working a bit with H2 over the past couple of days, and I am having some trouble. I run the program on one computer and add some data. Then, I try to run the same program on another computer (even through a shared folder over the peer-to-peer network), and it seems as though the database is stored locally, on each computer.

Now, I have a database set up with the URL jdbc:h2:C://DatabaseTesting/NewDatabase. I couldn't get it placed in certain other folders, but I figured this one will do.

Now, if I try to run this program on multiple computers, I can already see what the issue will be. It will create the database on each computer, locally, instead of only on the "server" computer. How can I get all of the computers to link back to the "server" computer for this application?

0条回答
登录 后发表回答