File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Embedding MySQL Database in Java Application

 
siva kumar
Ranch Hand
Posts: 120
  • 0
  • 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: 42966
73
  • 0
  • 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
Pie
Posts: 47244
52
  • 0
  • 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
  • 0
  • 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: 42966
73
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic