Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java and MySQL size issues

 
nikhil yekhe
Greenhorn
Posts: 9
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
Sylven Yip
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic