File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Embedding MySQL Database in Java Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Embedding MySQL Database in Java Application" Watch "Embedding MySQL Database in Java Application" New topic
Author

Embedding MySQL Database in Java Application

siva kumar
Ranch Hand

Joined: May 02, 2004
Posts: 120
Hi Friends,

I am attempting to develop an application that is used to display data from a MySQL Database.

The application should be self contained; Some thing similar to JOSE

http://jose-chess.sourceforge.net/index_manual.html

I need to know the following

How to Create a embedded database ( How can I import data from regular MySQL DB to an embedded MySql DB)

How to start the DB from Java

How to read from the DB

How to stop the DB from Java


If anyone can provide any reference to above tasks; I would be very much grateful.

If there is any sample application for the above tasks it would be great

Thanks in Advance
Siva
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41141
    
  45
MySQL is native code (I think C), which needs a proper installation - how are you going to embed that in Java?

There are very good embeddable databases available for Java, specifically Derby and HsqlDB.


Ping & DNS - my free Android networking tools app
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38045
    
  22
Agree with Ulf Dittmer. It is probably better design to have a separate database (MySQL will do nicely) and use a JDBC connection to it.
There is a section about databases in the Java Tutorial here. I don't think it covers MySQL however.
siva kumar
Ranch Hand

Joined: May 02, 2004
Posts: 120
Hi Friends,

Thanks for the reply.... I need to use a embedded DB

I couldn't migrate my current MySQL DB to embedded DB Like Derby or HSQL

IF you can provide any utility for automatic conversion that would be great.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41141
    
  45
I couldn't migrate my current MySQL DB to embedded DB Like Derby or HSQL


Why not?
siva kumar
Ranch Hand

Joined: May 02, 2004
Posts: 120
Hi

I took the backup of my MySQL DB using the MysqlDump utility

I tried to import the DB Dump into HSQL but I am getting sql Syntax error


Is there any embedded Java DB that uses the same SQL flavor as mysql or if there is any utility that can migrate MySQL DB to HSQL DB
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Try searching with Google for "embedded mysql java".

I found this, for example:
http://forums.mysql.com/read.php?58,65466,65466#msg-65466
http://jroller.com/page/mmatthews?entry=yes_it_really_is_this
[ May 11, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
Consider Paul's rocket mass heater.
 
subject: Embedding MySQL Database in Java Application
 
Similar Threads
java db on a mac-getting started
some queries about standalone application
Requirements for building Java GUI to access MySQL Database
application needs to store username and password
Please help me in creating setup in java