GeeCON Prague 2014*
The moose likes JDBC and the fly likes java apps with Mysql Database, want to port my database with my apps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "java apps with Mysql Database, want to port my database with my apps" Watch "java apps with Mysql Database, want to port my database with my apps" New topic
Author

java apps with Mysql Database, want to port my database with my apps

Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29



I have prepared an application that is a small demo of Student information manipulation. I have stored information related to students in a MySQL DB. Now my application is working 100% on my computer. But I want that work everywhere without depending on Database! I mean I just want "WHEREVER MY .JAR FILE GOES, DATABASE SHOULD ALSO GO ALONG WITH THAT INSIDE .JAR FILE "

So anyone who is using my application or trying it, they can realize exact result of this application.

How can I make this possible? Please someone help me.

For that I have done the following things:

1. I have installed MySQL database on my computer.

2. I have created a database on that MySQL server

3. I have created some tables in the database with a lots of data.. this data is to be used in my whole application, even for login.

Now I want to deliver this application to various clients but my clients are not technical persons and I don't want to give instructions to each of my client to do the above steps.

How can I integrate some functionality into my app so that they can use my database, Tables and Data automatically .

Regards..
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

If you don't want your clients to install MySQL on their systems (which is a reasonable thing to not want in your case) then you're going to have to stop using MySQL. If you want a database which goes along with your Java runtime and doesn't require any separate installation then Derby is what you're looking for. I haven't used it myself but from what I've seen you can run Java+Derby without having to run a separate database server.
Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29
is there any possibility of converting all my MYsql db into another like sqlite.. i mean i have developed my whole apps using mysql.. now changing db leads to a bulk of changes and more thing is i does not have any knowledge about sqlite..
my apps is a window based application.. so there is no need of a server which should be shared by all its users..
Regards..
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1134

Neha,
You said:

is there any possibility of converting all my MYsql db into another like sqlite

Yes, of-course you can migrate your MySQL database to another database, including Derby, as Paul suggested.
Your clients will need to install the JDK (as opposed to the JRE).
Please refer to the db subdirectory of your JDK installation.

Good Luck,
Avi.
Neha Kaushik
Greenhorn

Joined: Apr 03, 2013
Posts: 29
i got an idea of creating dump files of my db and then create a .bat file for restoring it at users system.. am i thinking in a right direction..??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
i got an idea of creating dump files of my db and then create a .bat file for restoring it at users system.. am i thinking in a right direction..??

No. A DB dump is only useful if the user has the same DB available. Since your dump would be from MySQL, and it was sort of established that it was unfeasible to expect your users to have MySQL, this doesn't really help. (As an aside, a .bat file works on Windows only - is that a realistic expectation with respect to your user base?)


Ping & DNS - my free Android networking tools app
 
GeeCON Prague 2014
 
subject: java apps with Mysql Database, want to port my database with my apps