Finished Java project, now creating jar or .exe file (with Database)

前端 未结 5 1849
臣服心动
臣服心动 2021-02-04 20:46

So, i\'ve just finished a small java application, with database and stuff... I used Netbeans and Mysql, now i want to export my project so i can use it anywhere i want; any comp

相关标签:
5条回答
  • 2021-02-04 20:55

    You can look at MySQL Connector/MXJ to embed your mysql database in your application.

    But be aware that this package is no longer under active development:

    Due to very low demand, MySQL has stopped development and support for Connector/MXJ. Source and binaries for previously released versions will continue to be available from archives.

    An alternative solutation would be using another database like SQLite, H2 or HSQLDB

    0 讨论(0)
  • 2021-02-04 21:01

    When you were programming in netbeans did you include the database within netbeans? Here is a guide on how to do this.

    https://netbeans.org/kb/docs/ide/mysql.html

    Also here is a second guide on how to Packaging and Distributing Java Desktop Applications

    https://netbeans.org/kb/docs/java/javase-deploy.html

    I hope these help.

    If not just go over your step you took to build the app.

    0 讨论(0)
  • 2021-02-04 21:03

    if you really want to give your users a good experience, I would suggest you implement a embedded database in your application instead.

    Look at: http://www.h2database.com/

    It's free and open source and I use it heavily myself. It supports embedded (where it creates flat database files on the computer), in-memory, and server-mode, where you have the possibility of letting multiple-applications share the same database.

    It's just a jar file you include in your application, and then the users wont have to install neither MySQL, have access to MySQL on a network drive or need other database software installed. (depending on your requirements, it might also be a good idea to look into Hibernate, to have some more abstraction between the different RDBMS).

    0 讨论(0)
  • 2021-02-04 21:08

    In order to get a database built-in to the application, consider HSQLDB, which is an in-memory database.

    http://hsqldb.org/

    It can run entirely in the JVM without any external resources.

    0 讨论(0)
  • 2021-02-04 21:09

    You can create an executable jar by exporting your project through eclipse. You can do this by following these steps:

    • Right click on the Project
    • Export as Jar file
    0 讨论(0)
提交回复
热议问题