• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

firtst foray into JDBC/

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
this is my first foray into the realms of JDBC/ODBC....

The aim of the code (below) is to fetch data from my database (later to be on my website) and return it to the client applcation where it will be updated. No changes are to be made to the database until all user changes have been made (maybe many/none).
the code (one of many) on the client side to invoke this is


This works fine.

The Question...
How would I make the same
"private static Set usersArray = new TreeSet();"
available to a 2nd user (via a second instance of the application) without accessing the database again.

Thanks in advance,
Gary



 
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i just don't get what you are trying to do. From my understanding, you want the usersArray object to be available for the next user. If you are using JSP or servlet for your application, you may want to put the usersArray object as an attribute in the Context of your application. In that way your object is visible for the rest of the application.
 
Gary Down
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arnel,
guess I'm not too clear..

This was written as a single user application running on a single desktop PC.
Now we would like to expand it to have the data held in a single central database (most likely on a website). The aim here is to allow several users access to the data. All the users (young students at that) will need to have access to the same starting information. Each student will update their respective copies of the data and then (when OKd by the teacher) the updates will be applied to the database.
The problem is that some students may finish before others have even started, causing the later students to begin with a different set of data.

Hope that is a bit clearer.

Gary.
 
Gary Down
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am I heading in the right direction....

I have been reading up on RMI and get the impression that I could create a server program, which when started could populate it's "Sets"

e.g. in this case "private static Set usersArray = new TreeSet();".

Then as each client transaction called to get the "Sets" it could just return them as required (given that the necessary functions have been implemented via the interface).

If so, and given the "main" coding below, what do I need to do in the "client" side and (if anything) external to the JAVA classes (e.g. policy file??)

Also,
At the moment I get
WBRemote exception: access denied (java.net.SocketPermission G resolve)
at the Naming.rebind statement


 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic