wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Local and remote database connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Local and remote database connection" Watch "Local and remote database connection" New topic
Author

Local and remote database connection

Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
In my opinion, implementing the remote database connection will automatically include implementing the local database connection. The only difference between the local and remote connections is the DNS and port number you specify in the command line argument. If you are using the own machine's DNS and port number, it will connect to your own local machine; otherwise, it will connect remotely. If that is the case, what is the point of specifying remote or local connection? Please correct me if I am wrong.
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Rudy, I think you are missing the point. When Sun says non-network mode, it means as if no tcp/ip and any type of networking level are installed on the machine; which means you can't use any DNS, or local port.
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Rudy -
What you're expected to demonstrate is code that does and does not require a network connection. This means one section of your code will not be able to use RMI.
This raises an interesting issue -- how to write server code that can protect shared data regardless of the type of connection the client has. In short, you have to separate issues of thread and synchronization from connectivity. Not hard, really, but you do have to think it through.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
If that is the case for local connection, I can have direct access to the database without using RMI or object serialization. The direct access could be the result of subclassing the provided data class. Is this true?
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Be careful how you think about direct access! The question here is ensuring that synchronization takes places regardless of the type of connection. If your scheme for "direct access" doesn't conflict with that, you're good to go.
Amanda Waite
Ranch Hand

Joined: Feb 04, 2001
Posts: 56
Hi Michael,
I passed the SCJD sometime ago with a good score but I dropped 20% on my GUI which I had thought was really great. The thought has just occured to me that maybe I mis-interpreted the requirements. I always planned to implement my direct access connectivity on my server until I really gave it some thought after which it really seemed pointless. I then implemented direct access on the client using a separate database which worked fine and seemed to satisfy the requirements. Do you feel that the Client in Direct Access mode should connect to an existing Database running on the same machine and therefore in the same VM?
My original plan was to have my simple server GUI with a button that launched a non-networked version of the client.
I don't need an answer, I'm just curious.
Thanks
Amanda
Originally posted by Michael Ernest:
Be careful how you think about direct access! The question here is ensuring that synchronization takes places regardless of the type of connection. If your scheme for "direct access" doesn't conflict with that, you're good to go.

Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
Thanks for Michael and Adrian's advice. After going through the requirement specification once more, you are right that the local connection does not rely on TCPIP. In that case, I come up with the idea of using the three-tier databse model. My approach will be to build an application server as the middle- tier that processes communication between the client application and the database which is in fact the database server. Using this approach, I can have a full control access to the database, and thus any thread-safe and multiple client access issues can be separated and implemented only at the database server. In addition, the database access will be completely transparent to the client regardless of remote or local, and therefore I can drop out the idea of direct access.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local and remote database connection