Storing current database name
I'm pretty new to java, but have been getting the hang of it reasonably well so far.
What I'm currently trying to do, is convert one of my PHP based programmes to JavaSE, however I'm a bit stuck at how best to handle remembering what database to use.
The programme is for event management, and when started, it loads up a list of events from what I call the Master database. The MasterDB contains a list of event names, along with the corresponding event specific database. Once you select the event, in PHP, the event specific DB name would then be stored in a session variable, and the event page(s) loaded.
What I'm struggling to do, is achieve something similar in Java for storing the current selected event specific DB.
At the moment, I've got a screen that loads a list of events from the MasterDB, and creates an Event Object for each event with the event name and event specific database.
Once an event has been selected, the selected Event Object is passed to the next screen, which then contains various jpanels/lists that should be populated from the event specific database.
What I'm not sure about is the best way to store the event specific database name, and access the database.
Should I create a seperate thread for accessing the database, then have each jpanel/class request resultsets via that thread, or pass the Event object to each jpanel/class that needs to access the database, then get resultsets via another db access class, or is there some other method I should be looking at?
Re: Storing current database name
Oops, just hit post too soon!
Incase it makes any difference, I'm using mysql for the database.
I have tried googling various terms, but I've not really found anything suitable, but that's probably because I'm not sure what exactly I should be searching for.