i want to create a software, in which what i need to do is, when i install that software in any
system, automatically account in the database should created, i mean i only need to distribute the installtion files to whom
who want to use that software.
at the time of installation it should ask how many users are there and based on that account in the database should created,
how can i do this??
also is it necessary that the system in which i m installing that software should have database, i mean if i use oracle, the
system in which i am installing that software should have oracle??
You can use an 'embedded db' to achieve this. JavaDB is a good choice.
so by using Java DB, i do not need to worry weather the system which is installing this software has database installed in his system or not, he only need jre, is it??
and is it possible to create dynamic installation file as i said, in which while installing it asks for number of users and create those number of account/table or whatever into Java DB??
Correct.
JavaDB is part of jdk since 1.6. You can see in the features page which shows that this can be run in 'embedded' mode.
When you run the application first time, you should 'create' the database which can be done via API call. This will have the database in the local hd. Whenever the application starts, you should 'start' the database and stop it when the application stops. Again, all these can be done via API call.
Once the DB is started, connecting to and performing CRUD operations are usual JDBC stuff. The JavaDB ships with a JDBC driver for connecting to a JavaDB database.
Edit: The user only needs the JRE, but you should include derby.jar when you ship the application (Derby is the original Apache's open source project which is now supprted by Oracle called as JavaDB). I don't think derby.jar is included as part of jre.
You can read this link to understand how to use JavaDB in embedded mode.
I see that you created another thread about the same question for making it an executable.
Like I pointed out, you need to write code to create the embedded db the first time, and then have code to start/stop the db. When you distribute the app, you will include all your jars along with derby.jar.
If you want to make it an executable, you can use launch4j to create an executable (with option to bundle JRE itself). Or, if your's is a NetBeans project, you can right-click on the project and use Distribution menu options to create an executable/zip.
thank you very much, i will create a jar file of my class, after that???
do i need to include my jar file and derby.jar using this software Launch4j isn't it??
No. If you read through the link, you can see that you can run standalone jar files with: 'java -jar <jarfilename>.jar' (in most machines, simple double-clik on the jar file will bring up the app).
Also, in subsequent sections, it is shown about how to include other jars in your classpath. That is where you have to specify derby.jar. Follow that and try it out. You won't need to make any executable at all in most cases (I started talking about launch4j thinking that you were already aware of standalone jars)...
yes i will read that link, but i just want to know one more thing, if i want to create a installer than do i have to use that launch4j???
(installer i mean, ie(any software we install))
I don't think you need an installer. You are using Eclipse IDE, how did you install it? most propably, you got a single zip file and unzipped it, right?
So, you can do the same. Just put all your jars in a single zip file and send it across. All the user needs to do is just unzip and the app is ready.