Java Reference
In-Depth Information
In Figure 9-10 we can see that the fifth Local Address is listening on port 1099. The port
that the server itself is running on is unknown—it will be dynamically configured by the RMI
registry.
Running the Client Application in Networked Mode
Running the application in network mode requires specifying the IP address or host name of
the machine that the server and database files are located on, the port number the RMI reg-
istry or the server is listening on, and the server type. To start the networked client, at the
command prompt type the following:
javaw -jar sampleproject.jar server
This should bring up the connection configuration dialog box shown in Figure 9-11.
Figure 9-11. Starting the networked client
Enter the location of the database (either by the name of the computer hosting the data-
base, e.g., localhost , or by the IP address of the computer host, e.g., 127.0.0.1 ), change the
port number if necessary to match the port number specified when starting the server, and
select the same network type as specified when starting the server. Then click Connect , and the
main window will load as shown in Figure 9-7 earlier.
Testing
In version 2.0 of Denny's DVDs is a package called test , which is in a different directory struc-
ture than the standard source. The standard source is in the directory named src , while the
test package is in a subdirectory called test . The different directory structures will assist us to
ensure that we do not submit any classes we do not want to submit—this will be explained in
the “Packaging Your Submission” section later in this chapter.
This may be a little confusing, so we recommend you look at the directory tree structure
displayed in Figure 9-12. If you have been following along with this chapter, you will have a
root directory similar to D:\dennysDVDs2.0 (the actual drive and directory can be different). In
that root directory so far are the directories classes (where javac has been storing our com-
piled classes), src (which is the root directory for our sample assignment source), and test
(which is the root directory for our test source). Our package structure appears within each of
those directories, starting with the top-level package named sampleproject .
Search WWH ::




Custom Search