aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UrlyBird:different ways for conection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UrlyBird:different ways for conection" Watch "UrlyBird:different ways for conection" New topic
Author

UrlyBird:different ways for conection

Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
Hello , I have some doubts , about UrlyBird :

1-Whichever ways of connection exiten? , may be :

alone:local mode, enter location of bd.
Networked:enter the port and location of bd.
Omitted:enter the port , ip and location of bd.

2-The location of bd in networked or omitted is : the location in server or in local machine ?, and I have that copy the file in the directory that I want , and the original file to mantain it , in the working directory??.

3-If I conect with the networked mode or omitted and I enter the port or ip , and the location file and other person conect with the same mode ,
it is necessary to return to introduce localizacion of the file?.

4-I can deleted and to create records ? , in html file say :�it must allow the user to book a selected record , updating the database file accordingly� , but this file don,t say deleted or created .
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11479
    
  94

Hi Irene,

Originally posted by Irene Rodriguez:
1-Whichever ways of connection exiten? , may be :


If you omit the possible parameters, then you are connecting to the remote server, which already knows where the database is. So, from the perspective of the client, the server port and IP address is the location of the database.

So I would rewrite your connection option as:



Originally posted by Irene Rodriguez:
2-The location of bd in networked or omitted is : the location in server or in local machine ?, and I have that copy the file in the directory that I want , and the original file to mantain it , in the working directory??.


For the server, the location of the database will appear to be on the server's computer.

For the networked client (parameter omitted), the location of the database will be the server itself. The networked client will not know the physical location of the database (that is, it will not know the directory the database is in) - the networked client will only know that it can use the database that is accessible via the specified IP address/port.

The database may not necessarily be in the working directory. Check your instructions - I think you may find that the standard location for the database is the root directory where your executable jar file is located. However there is nothing to say that the user will start the jar file from that directory, nor that the networked clients will get anything other than the jar file.

Where you keep your original file is up to you .

Originally posted by Irene Rodriguez:
3-If I conect with the networked mode or omitted and I enter the port or ip , and the location file and other person conect with the same mode ,
it is necessary to return to introduce localizacion of the file?.


I think I covered this earlier.

Originally posted by Irene Rodriguez:
4-I can deleted and to create records ? , in html file say :”it must allow the user to book a selected record , updating the database file accordingly” , but this file don,t say deleted or created .


The Data class must implement your provided interface, and that interface requires methods to do creations and deletions.

But you are quite correct - there is no requirement for the GUI to support creations or deletions.

Regards, Andrew
[ February 15, 2005: Message edited by: Andrew Monkhouse ]

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
Ok , thank in advance .

This mean that :


Local: location of bd in local computer.
Server : port and location of bd in the server computer.
Omitted: ip and port of the server ( bd location I don,t know )

and about the other question , I don,t understant it very well . For example , if the location of bd is in c:/bd/location and when I conect it , I want that the location of bd is c:/bd , I should to copy the database file??

Thanks.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11479
    
  94

Hi Irene,

Originally posted by Irene Rodriguez:
This mean that :

Local: location of bd in local computer.
Server : port and location of bd in the server computer.
Omitted: ip and port of the server ( bd location I don,t know )


Correct.

Originally posted by Irene Rodriguez:
and about the other question , I don,t understant it very well . For example , if the location of bd is in c:/bd/location and when I conect it , I want that the location of bd is c:/bd , I should to copy the database file??


Perhaps I am misunderstanding you, but it sounds like you are trying to copy the database file from within your Java application. If so, then you should not be doing this.

When you connect in local mode (using the parameter 'local'), your application will prompt you to enter the location of your database�. You might want to consider having a browser to assist the user in selecting the location of the database. Once the user has entered the location of the database, then you perform all your database operations (reads and writes) on the file that the user has selected.

When you connect in networked mode (using no parameters), your application will prompt you to enter the location of your server (IP Address and port number)�. In this case the database file will remain on the server, and all database operations (for example a 'read' operation) will be sent to your server application, which will do the real work on the database file on the server.

Note �: This information (either database location in local mode, or IP address and port number in networked mode) should be persisted in a properties file in the user's current working directory. So the second time that they run your application you can read the properties file and provide defaults for them to approve.

Regards, Andrew
Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
Ok , I understand , that instead of choose bd location , I choose tha bd with I will work , is correct ?

In networked mode I �musn�t choose the bd , and single I , that is in the server .

But my question is in server mode (parameter no omitted ).

Thanks.
Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
and other doubt that before one has forgotten to me , when I must be executable using a command line :

java -jar ....

I suposse that with this line runner server and client or I must execute first with server and after with client??

thans again.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11479
    
  94

Hi Irene,

Originally posted by Irene Rodriguez:
Ok , I understand , that instead of choose bd location , I choose tha bd with I will work , is correct ?


Hmmm, I think your confusion has come from the following line(s) in the instructions:

Extract from instructions:
All elements of your submission must be packaged in a single JAR file. The JAR file must have the following layout and contents in its root:
  • ...
  • The original, unchanged database file that was supplied to you. Note that you must keep a copy of the original database file supplied to you, and this must be the file you submit. The marking process will expect the exact same data without any changes.
  • ...

  • The section "you must keep a copy of the original database file supplied to you" is describing what you must do - not what your program must do. You must keep at least one original backup copy of the original database, so that you can then provide that original copy to the assessor.

    Extract from instructions:
    [You may choose between] RMI or serialized objects... 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...


    This is where we get to the confusion about specifying a location of the database.

    The command line parameter 'single' is an indicator that a local database is to be used .

    However for either 'single' or 'server', you will need to "specify the location of the database". Using a JFileChooser to select the location may make this easy for the end user. You may wish to create some FileFilter(s) to assist the user in finding the file (I had three - the full name of my database, just the extension for a generic database, and the generic '*.*').

    The first time your application (either stand alone client or server) is run, you won't know where the database is stored. You may wish to default to the location of the jar file (since that is where you distributed it). After the first run, you will be persisting the location in a properties file.

    Originally posted by Irene Rodriguez:
    In networked mode I �musn�t choose the bd , and single I , that is in the server .

    But my question is in server mode (parameter no omitted ).


    Extract from instructions:
    [You may choose between] RMI or serialized objects... 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...


    So from that, for both standalone client (alone) and server (server) you will need to allow the user to choose the location of the database.

    Regards, Andrew
    Andrew Monkhouse
    author and jackaroo
    Marshal Commander

    Joined: Mar 28, 2003
    Posts: 11479
        
      94

    Hi Irene,

    and other doubt that before one has forgotten to me , when I must be executable using a command line :

    java -jar ....

    I suposse that with this line runner server and client or I must execute first with server and after with client??


    When running in client/server mode, you will have multiple clients connecting and disconnecting from the server. So they will need to be started independently.

    Regards, Andrew
    Gerenne Vives
    Ranch Hand

    Joined: Feb 05, 2005
    Posts: 60
    Ok , thanks very much for your help.

    Now I already understand it.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: UrlyBird:different ways for conection