• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent-Please give some hints

 
walter wang
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all of you attention
I had 3 questions please give some hints
1) * @exception IOException If the record position is
invalid.
*/
public void lock(int recno) throws IOException
what does the record position is invalid mean?
2) on instruction it said..". 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"
what does "must allow the user to specify the
location"of the database mean?
it means user could input db.db 's diretory?
3)on instrucion it said..."Writing Data Client
To connect with your server, you should create a
client program. This implementation should include a
class that implements the same public methods as the
suncertify.db.Data class, although it will need
different constructors to allow it to support the
network configuration."
i design a Clientlogic which only has book and search
is it data client? if it is.why i need implemnt
all public methods as the suncertify.db.Data class
in it?
 
Akanimo Udoh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are replies to your enquires:

1) * @exception IOException If the record position is
invalid.
*/
public void lock(int recno) throws IOException
what does the record position is invalid mean?

An invalid record position would be an integer less than -1 or equal to zero (since its 1 based indexing) or greater than the number of records in the database.
2) on instruction it said..". 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"
what does "must allow the user to specify the
location"of the database mean?
it means user could input db.db 's diretory?

There are two main ways to specify "location of the data" and depends on whether the data being accessed is local or remote:
i) Local Data - Allow user to specify the directory and filname of data file.
ii) Remote Data - Allow user specify address of remote server and port on which it is serving the data.
3)on instrucion it said..."Writing Data Client
To connect with your server, you should create a
client program. This implementation should include a
class that implements the same public methods as the
suncertify.db.Data class, although it will need
different constructors to allow it to support the
network configuration."
i design a Clientlogic which only has book and search
is it data client? if it is.why i need implemnt
all public methods as the suncertify.db.Data class
in it?

What they want you to do is to write some type of class so that all the methods that can be called on the Data class can be called by the client for a remote server. You would then probably use this class to implement the Clientlogic class functions. The idea is that someone should be able to pick up your class and use it in his code to connect to a remote database and call all those Data methods.
Hope this helps.
Akanimo.
 
Adithya Rayaprolu
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think the client should not bother about the exact location (directory and filename) of the database in local mode. The client just says 'I want to connect to the database locally', he does not need to know where exactly the database resides(in our case the absolute path of db.db file), it is upto the server to connect to the existing database. Can somebody say I am right or wrong?
In remote mode, is it necessary that we give port number? Can I always assume that the registry is running on the default port?
Thanks in advance.
 
walter wang
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Adithya Rayaprolu:

I think the client should not bother about the exact location (directory and filename) of the database in local mode. The client just says 'I want to connect to the database locally', he does not need to know where exactly the database resides(in our case the absolute path of db.db file), it is upto the server to connect to the existing database. Can somebody say I am right or wrong?
In remote mode, is it necessary that we give port number? Can I always assume that the registry is running on the default port?
Thanks in advance.


I think better to give port number specifically.even
server also used default port number.
btw,thanks for help


[This message has been edited by walter wang (edited June 27, 2001).]
 
Akanimo Udoh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
adithya,
I Read your mail. I have to agree that when connecting to a remote server the client will not need to specify filename / directory but will just connect to the server and get whatever data its server.
For local clients you will have to specify the local directory and filename (as specified in the instructions which make provision for "filename(s)" in the command line and says that the application "...must allow the user to specify the location of the database..." this is different from "...must also accept an indication that a local database is to be used..." which is also specified.
About the ports its a good idea to specify the port since the user might be running a variety of services on the same computer. I wouldnt advise assuming the registry is present on a particular port. What I did was to check to see if the registry existed on the specified port and if it did register to it, else I used java.rmi.registry.LocateRegistry.createRegistry (...) to create my own and host internally.
You might want to check that option out.
 
Adithya Rayaprolu
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I pass command line arguments something like this?
java client local dblocation ( for local mode )
java client remote hostname port ( for remote mode )
Thanks.
 
Akanimo Udoh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adithya,
Only thing i see wrong with the command lines is the inclusion of the 'local' or 'remote' specifiers. Unfortunately this isn't among the list of 'approved' command line parameters.
  • DNS name of the server

  • Port number used by the server

  • Data file name(s)

  • java.rmi.server.codebase

  • security manager policy file

  • I suggest that you use the number of parameters given to determing if its either local or remote. From your own example, local connection has 1 parameter and remote has 2.
    Akanimo.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic