views:

392

answers:

3

One thing I love about .NET is the ability to have a database file along with the project. I know that using a SQLite database, this can be done, but did someone achieve this with a MySQL database backend?

So for instance, if I run a java program, it should be able to start its own mini MySQL server and manipulate data. So essentially, I want the same flow as with a SQLite but I need the power of MySQL.

+5  A: 

A quick search shows this: MySQL Connector/MXJ — for embedding MySQL server in Java applications on the MySQL Downloads page at:

http://dev.mysql.com/downloads/

Legend
+5  A: 

It sounds like you want an embedded database. While MySQL Connector seems nice, it will launch a separate server process. If you want the database server to run in the Java virtual machine, there are several embedded databases for Java.

The two that I've seen used the most are:

  1. Apache Derby / JavaDB
  2. HSQL
Steve K
+2  A: 

For future reference to anyone looking to embed mysql, there is a utility from the mysql guys that does this http://dev.mysql.com/downloads/connector/mxj/5.0.html

robinsonc494