开发者

How to Bind MySql Database inside a JAR file of any application?

I have prepared an application that is a small demo of Student information manipulation. I have stored information related to 开发者_StackOverflow社区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.


You will probably need to look at something like HyperSQL, which is a in-memory database (which you will need to populate at application start-up). Or have a look at SQLite, which is an embedded databsase, which you can distribute as a resource in your jar.


This doesn't work. MySQL is a full-blown RDBMS. You would have to install it on every computer if you want application to use it locally. An alternative would be using SQLite.

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.

SQLite and Java

SQLite seems to be a good fit for your requirements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜