• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to create dynamic installation or exe/setup file?

 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??


 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use an 'embedded db' to achieve this. JavaDB is a good choice.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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??
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay, Thank you...
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I see that you created another thread about the same question for making it an executable


I am sorry for that..

and i wrote code for create embedded db



now my question is how to include this?
simple class file ie. Test.class???
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Punit Jain wrote:
now my question is how to include this?
simple class file ie. Test.class???



include where?
Have you ever created a standalone jar file? you should start from there...
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no i have never created, and i m using eclipse.
how do i create a jar file??
and after that what next to do??
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this: link
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)...
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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))
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya got it...
thank you...
but again for any of my project if i need installer, do i need to use launch4j???
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. For an installer, you should look at something like izpack
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you..
 
Ranganathan Kaliyur Mannar
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic