• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Embedding MySQL Database in Java Application

 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 74004
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 43026
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic