Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connect Automatically to Database on program start up  RSS feed

 
Sammy Bill
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have an application that connect to HSQLDB. What should i do in order to have HSLDB load on program start up automatically without having to run the server manually?

Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36463
464
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of application? Web app, standalone program, swing interface? How do you define starting up? Does something happen?
 
Sammy Bill
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:What kind of application? Web app, standalone program, swing interface? How do you define starting up? Does something happen?


it is a swing application. for example, I dont have to go and run the hsqldb server manually. When i run the application I want the server to run automatically.

one more replated question. If i compiled my application into an exe file and distribute it. how would it run the DB server and create the tables the first time a user run the executable file?

Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36463
464
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oussama M Billah wrote:
Jeanne Boyarsky wrote:What kind of application? Web app, standalone program, swing interface? How do you define starting up? Does something happen?


it is a swing application. for example, I dont have to go and run the hsqldb server manually. When i run the application I want the server to run automatically.

That actually makes it a Swing question more than a JDBC one. I'm going to move this to our GUI forum so someone who knows more about Swing startup can answer it.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, this is more of a question about HSQLDB. This link tells you how to execute HSQLDB in an in-process mode which is what you want.

As to your question about turning your swing app into an EXE, there's really no need to do this but if you must it will depend on the tool you use to accomplish this. So I'm afraid I can't answer that question.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!