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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java and MySQL size issues" Watch "java and MySQL size issues" New topic
Author

java and MySQL size issues

nikhil yekhe
Greenhorn

Joined: Jun 29, 2007
Posts: 8
I am using a very small program with conjunction of mysql DB. The problem is I want to deploy it on some other pc, the size of my program is few kbs but for running DB I need to install 45MB+ worth MySQL DB. Is there any lite version of DB which I can use for running the program? I just don't want to install the BIG database.


Nikhil Y
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

Hi Nikhil,
If you are determined to use MySQL then you have no choice but to install the Database.

If you are not determined to use MySQL then you can go with Derby (less than 3 meg for deployment) you can find migration documents from migrating your MySQL database to derby in its web site. http://db.apache.org/derby/


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Sylven Yip
Ranch Hand

Joined: Aug 30, 2007
Posts: 42
hi!
if your program does not contains a huge data, you can choose to store data in a file(using datastructs such as hashtable)
nikhil yekhe
Greenhorn

Joined: Jun 29, 2007
Posts: 8
That was my first thought.But that may create the security issues. Also outside program file modification may create major malfunctioning.
Sylven Yip
Ranch Hand

Joined: Aug 30, 2007
Posts: 42
your worry about security is right.
in china,there are many software are just designed for information collection.considering the same problem of yours,they chose store data just in files.
but when you try to read informations directly from files.what you can read is Gibberish.
so one solution:
1.encrypt your data before store them into files.

including database,local data is never safe.fact,some bad guy can't login your database to modify your data,but he can destory your database instead(uninstall).
so another solution:
2.you can use reomte datasource instead.in that case,you need not to worry about security problem and size problem.but it bring another problem:you must create a remote server so that the client can visit the data in anytime.
nikhil yekhe
Greenhorn

Joined: Jun 29, 2007
Posts: 8
Those were some nice facts you quoted there. Yes usage of encryption is good solution. But Data organization and statistical problem still have to be faced. Though writing the encrypter interface is good idea.
Sylven Yip
Ranch Hand

Joined: Aug 30, 2007
Posts: 42
yes,database is always the best way to store data.
maybe you can try another smaller database.
such as some small db--HSQLDB,H2 or even some bigger--Apache Derby,javadb.

at the same time,you can use JNI and Runtime.exec() to package the database into your program installation.and then install automaticlly.
nikhil yekhe
Greenhorn

Joined: Jun 29, 2007
Posts: 8
at the same time,you can use JNI and Runtime.exec() to package the database into your program installation.and then install automaticlly.


Can You elaborate on How to do this and info and that sort of things for this.
Sylven Yip
Ranch Hand

Joined: Aug 30, 2007
Posts: 42
in windows platform,you can do that by using some professional software-InstallShield,WiseInstaller to package the database client
,it automatic finish DLL、OCX、DATA encapsulations.
it will help you to finish the databse deployment.

but how can java do the same thing? may be we use InstallAnywhere(i am not sure wether this software can do the same thing).
I think,at least,we can write the execute process into a batch.and then execute by exec() to do the same thing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java and MySQL size issues