Ishadi Jayasinghe
Ishadi Jayasinghe

Reputation: 122

MySQL database in a different server than MySQL server

I had been using MySQL server for all my database tasks but it's always giving me problems when trying to connect.Is it possible to use some different server like JBOSS, wildfly or Tomcat to host my SQL database?

Upvotes: 1

Views: 69

Answers (1)

Olaf Kock
Olaf Kock

Reputation: 48057

If you have problems with the connection, I'd rather advocate for fixing those connection problems than jumping ship just because of this, because you'd give up a lot of additional features that a server like mysql provide under the hood (if only the ability to run an application independent backup).

That being said, there's hsqldb which you can run embedded. Note though that this won't be good if you have large amounts of data (as it's generally "in memory") and the file format is not the most robust: It's saving its content in a raw text format that will sometimes be rewritten. If your server just crashes or runs out of memory, this might corrupt your database. Full fledged servers (like mysql or postgresql or others) typically go quite some length to save you from loss of data in these cases.

hsqldb would basically just be a driver that you embed in your web application and configure its storage location through the database URL that you specify.

Perfect for quick demos, proof of concept, development and test. Your mileage may vary for actual production deployment where you can't risk to ever lose your data.

Upvotes: 1

Related Questions