Results 1 to 2 of 2
  1. #1
    m_c
    m_c is offline Member
    Join Date
    Aug 2013
    Posts
    5
    Rep Power
    0

    Default Storing current database name

    Hi,

    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?

  2. #2
    m_c
    m_c is offline Member
    Join Date
    Aug 2013
    Posts
    5
    Rep Power
    0

    Default 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.

Similar Threads

  1. Servlet Program for storing a file in database
    By aravind raaj in forum New To Java
    Replies: 2
    Last Post: 07-18-2012, 11:21 AM
  2. storing jcheckbox value to database sqllite
    By bikkerss in forum New To Java
    Replies: 1
    Last Post: 05-16-2010, 01:15 PM
  3. Storing video files in mysql database
    By mrvigneshmca in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2009, 04:50 PM
  4. Storing image loaded in applet in mysql database
    By mrvigneshmca in forum Java Applets
    Replies: 1
    Last Post: 03-20-2009, 05:17 PM
  5. storing exel data to access database
    By sijokunnappilly in forum Advanced Java
    Replies: 1
    Last Post: 10-30-2008, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •