This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to process the networking with a local database? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to process the networking with a local database?" Watch "How to process the networking with a local database?" New topic
Author

How to process the networking with a local database?

Along huang
Ranch Hand

Joined: Feb 09, 2004
Posts: 72
In the instructions, here is a sentence describing the networked mode.

Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database, and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access.


I have two questions that maybe I misunderstand.

1. and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.
If the Server accept a local database, and locate in a computer which is different from one the Client do, what do it mean? If the networking should be bypassed?
Indeed, I can't understand the sentence.

2. No authentication is required for database access.
If it mean a security manage is not required in accessing database?


best regards
Along


SCJP1.4 SCJD 2<br />SCEA(In progressing)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

1. What that menas is that in local mode there is no server running.

2. No security is needed for the Data file. No Username No Password.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Along,


2. No authentication is required for database access.
If it mean a security manage is not required in accessing database?


Normally with jdbc we need to provide userid and password to get a connection to db. This database access authentication is not required here.


1. and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.
If the Server accept a local database, and locate in a computer which is different from one the Client do, what do it mean? If the networking should be bypassed?
Indeed, I can't understand the sentence.


I came to the same situation while reading the first time. After reading the entire requirement I understood that "stand alone" version is referred by "the networking must be bypassed entirely".


In either case the program must allow the user to specify the location of the database

interested me. What I understood follows. This should be applicable in client server mode alone. What is meant by "either" above is "your choice of RMI or Seialized objects". In this case the user should be able to specify a database location. Database location is nothing but server location itself.

The database is a collection of entities including the .db file, the accessor utility (server) , locking mechanism, DB interface and the class implementing DB interface.

Remember that we are just creating a database and a database client dedicated to an application. The database and database client can run in same jvm or in multiple machines.



and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely.

This is applicable only in stand alone mode. This indication is the mode flag itself.



If the Server accept a local database, and locate in a computer which is different from one the Client do, what do it mean? If the networking should be bypassed?


Server itself is the database. I am assuming that .db file can be either in the same machine as database runs or in a different machine. It really doesn't matter because whatever be the mode the server will know where the .db file is. The user don't have to bother about the location of .db file.
[ October 29, 2004: Message edited by: jiju ka ]
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
All you need to do is in GUI. If the GUI is run under client server environment, provide a field to user to specify the server location. GUI will convey the location of server to network client. Network client will use the server location to locate server.

If the GUI is run under stand alone environment don't provide a field to user to specify the database location. Because the mode indicates the GUI to bypass the network and find the database in same jvm.

This is something I like with SUN's testing strategy. Eventhough this requirement is a puzzle - the emphasizes is on the need on a developer to understand requirements and avoid assumptions. You have done a good thing in asking this question.

[ October 29, 2004: Message edited by: jiju ka ]
[ October 29, 2004: Message edited by: jiju ka ]
Sean Gildea
Ranch Hand

Joined: Jul 01, 2004
Posts: 81
Jiju,

In the gui you described, for local mode:

1. Would you have the user provide the physical file location of the db file in say a drop down menu, say File > Connect.

2. And if so, should you disable all buttons until they connect as well?

thx


SCJD, SCBCD, SCJP
Along huang
Ranch Hand

Joined: Feb 09, 2004
Posts: 72
I agree with jiju vary much!

There are some requirements that puzzle candidates, however, those requirements whip up candidates to find the answer, in this process, it trains you to become a mature developer.

thank you for reply!

Along
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Sean,
I assume you meant standalone mode by local mode.


1. Would you have the user provide the physical file location of the db file in say a drop down menu, say File > Connect.


My suggestion is "No". The users are not supposed to know the physical file location. I would rather put it as a configuration parameter with the database - read it from a file.

There are several pros and cons on having client vs server(database) having file location.

Suppose there are 10 clients. Each client need to know what that field (file location) in GUI means, the value of file location if it need to be typed. What will happen if the file location is changed? If there is an old and new location some users may still point to the old file by mistake.

Instead if you have the file location with server, you need to change it at only one place and "not needed to communicate the change to the clients".

CSR's (clients) normally don't do configuration stuff. Specialized role like administrators do that. If you wan't to have configurables changed using a GUI your best bet will be to have extra screens for administrators. Since the project is like a learning test you can add as many features to it as long as you are not violating any musts.

If it was me I will not consider adding new features until I implement all must's. Later the new features can be considered to be added. There comes the need for an iterative development.

According to me File location has to be encapsulated with database. There may be different opinion. To those ask these question: In an Oracle or db2 database do the client (jdbc programmer for example ) need to specify physical database file name or location (not table, schema or table space)?

[ November 01, 2004: Message edited by: jiju ka ]
[ November 01, 2004: Message edited by: jiju ka ]
Rocio Sanchez
Greenhorn

Joined: Nov 02, 2004
Posts: 1
Hi jiju,

Thank you by all your explanations. When you say:


"The users are not supposed to know the physical file location. I would rather put it as a configuration parameter with the database - read it from a file."

1- That suggestion doesn't apply to the below "must", in this case the configuration parameter must be read from the GUI and stored in a suncertify.propierties file, on the other hand, It can be interpreted as you have explained before?

2- And, What is the meaning of "must be persistent between runs of the program"?

quote:
--------------------------------------------------------------------------------

All configuration must be done via GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.propierties.

--------------------------------------------------------------------------------

THK
Rocio
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306

2- And, What is the meaning of "must be persistent between runs of the program"?

If a configurable parameter is altered it should be stored(write to suncertify.properties ). The next time the application is brought up you should read the configurable value from suncertify.properties If you do this you should be careful though - the event/time from which the new configuration is effective is extremely important. Basically you have to make sure that "While the configuration change happens a user is not disconnected and connected to another file between his/her writes" - so locking the whole file is must in production environment. Because of this reason it is too risky to implement this feature. Or alter configuration only in stand alone mode. It is not a must from Sun though.


1- That suggestion doesn't apply to the below "must", in this case the configuration parameter must be read from the GUI and stored in a suncertify.propierties file, on the other hand, It can be interpreted as you have explained before?

I understood your point. If I were to allow configuration change, my choice is to have a separate screen for configurable parameters. So there will be a mutually exclusive set of screens the users and administrators have access to.

If you combine the user and administrative screeens into one the application can enter inconsistent state.

In a typical development environment the development happens in several phases/tiers. There will be a development, integration, acceptance and production tier. There will be more than one db file too. If a client changes file location the change actually takes place in server(database). Depending on who changed last all clients will point to the last specified location - result data loss, uncommitted transactions and lots of frustration.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to process the networking with a local database?
 
Similar Threads
URLyBird database location
Confusion about requirement
FileChooser
database? it's database server or database file?
Design