1

I'm creating a java desktop application using swing which requires some database persistance for which I'm planning to use Hibernate. I'm pretty new to desktop application development so I wanted to know if and how the database can be created on the client computer when installed.

Is there a script to be run or maybe a hibernate configuration which initiates database creation?

A sample tutorial or example illustrating this will be ideal (although I was not able to find one).

Thanks in advance for any help provided.

4
  • you can create database table using hibernate please follow link before that you need to install my sql database Commented Dec 31, 2013 at 6:22
  • correct, but this requires the manual database connection to be made in mysql. I'm looking at a way in which maybe the database can be exported with the java application or create a new database after installation. My objective is to keep the database creation concealed from the user but be able to use it from the application. Thanks for the swift response though! Commented Dec 31, 2013 at 6:32
  • You could take a look at some of the stand Aline databases like H2 or HSQL Commented Dec 31, 2013 at 7:05
  • What is the size of data you will want to store? Commented Dec 31, 2013 at 8:35

4 Answers 4

2

Hibernate is not an database server itself, it is a object-relational mapping framework so you need a either embedded or stanalone database server. Java DB that comes with the JDK will be sufficent for desktop applications.

Sign up to request clarification or add additional context in comments.

Comments

0

http://hamidseta.blogspot.in/2008/05/install-mysql-server-50-silently.html

In your package installer scripts perform the steps of silent MySql installation. In the BAT file put the code you find in the above link before triggering your Java application installer.

As per free licensing terms, one should not package MySql bundle for free, just check about the licensing if you bother.

Comments

0

I think it would be better if you can start with javaDB or SQLite. They are perferred embedded database technologies for desktop java applications. You can download the jar for sqlite-jdbc from here.

Take a look at few tutorials on JDBC

If you making swing applications, make sure you learn to use swing worker well. It will be important to perform background processing.

Comments

0

Hibernate is Framework used as middle layer in project which interact between database and Business layer logic. Hibernate features

  • J2EE integration
  • Object/Relational mapping
  • Automatic primary key generation
  • Object-oriented query language

So my suggestion is to go with MySQL because

  • Handles large databases. We use MySQL Server with databases that contain 50 million records. We also know of users who use MySQL Server with 60,000 tables and about 5,000,000,000 rows.

  • A very fast thread-based memory allocation system.

  • Very fast joins using an optimized one-sweep multi-join.

  • The server can provide error messages to clients in many languages.

    This is only few features but you go to official site for more detail. And most important it's open source.

And the post help to install and configure on client system.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.