This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Embedding MySQL Database in Java Application

 
siva kumar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Campbell Ritchie
Sheriff
Posts: 48423
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't migrate my current MySQL DB to embedded DB Like Derby or HSQL


Why not?
 
siva kumar
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic