I'm about to make a game to test networking in java (I've worked with networking in other programming languages, so I'm semi-familiar with it.) It seems that every language I've tried has a different preferred database software. For PHP, it was MySQL. For Javascript (Node.js) it was either MongoDB or Redis. etc. What's java's preferred database? Anyone have some recommendations?

I prefer PostgreSQL to MySQL from an administrative point of view. Their user model is so much saner.

PostgreSQL is far superiour to MySQL. The only thing holding it back is the unpronounceable name. Imagine introducing both MySQL and PostgreSQL to your manager, now imagine what he'll pick. Yes, that's how it goes.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

Not really, Hibernate translates the Java object definition into an equivalent relationship schema, and then automatically performs SQL queries to update, insert and select rows and convert them into java objects using byte code and reflection.

I prefer PostgreSQL to MySQL from an administrative point of view. Their user model is so much saner.

PostgreSQL is far superiour to MySQL. The only thing holding it back is the unpronounceable name. Imagine introducing both MySQL and PostgreSQL to your manager, now imagine what he'll pick. Yes, that's how it goes.

I find that incredibly amusing, since MySQL was made by a Swedish guy and named after his daughter, My. "My" in Swedish is pronounced like a long version of the Y in "mystic", not like the English word "my" as in "My own car". Even funnier "mys-kul" (same Y as in the name My) would mean something similar to "cuddle fun".

Interesting, but you have to agree that 'that swedish guy' was not a complete moron and realized that everybody else would read is as the english 'my', making it feel friendly towards the developer (and manager). It's the same concept as 'iMac, iPod, iPhone, iPad', it feels accessible.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

You have 2 reasonable options, MySQL and SQLite. Depends what you are making. If you need a real relational database (like if you are making MMORPG) go for MySQL. If you are making something smaller (or to be more precise something with low amount of concurrent writes) go for SQLite, which is smaller, easier to install and is used on smartphones.

There are OR-Mappers and there are OR-Mappers. Yes, full blown OR-Mappers with their own SQL dialect are a pain in the ass, but at the other end of the spectrum, it's an even nastier pain in the ass to have to stuff those resultsets into HashMaps or instances of your own classes manually.

I usually work with utility methods that for generate the often used queries, like a simple SELECT statement (listing the columns in a table) and methods that pump the resultset into instances of classes that have the same structure as the table. It has support for foreign keys, to make it a bit more convenient. If I weren't allowed to use such a minimal OR-Mapper, I'd probably quit that job. Life is too short to write SQL in Java.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

When picking your data store I'd say it's not about what language you're writing your code in, but rather what kind of data you're intending to store and what the requirements around reading and writing are.

I would also suggest you stay away from OR frameworks or at least seriously evaluate the pros and cons of using one. They tend to put you in a right mess if you use them the wrong way.

I really liked using hsqldb. Its a Java DB with some quite nice features.-in memory db inside your own application(no server setup required).-write some sql commands in java(don't know what they are called, like insertion hooks)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org