Java Reference
In-Depth Information
9.
In DBAccess, add the following three statements that identify the location of the DB2
database, as well as the user ID and password to access the database. Then modify the
statements to reflect your information. In other words, in the first statement, substitute the
host systems IP address or domain name that you will be using in place of 111.22.333.444.
In the second and third statements, change the user ID and password (bjanson and jeter)
to your user ID and password.
private String url = new String("jdbc:as400: 111.22.333.444 ");
private String userid = new String(" bjanson ");
private String pw = new String(" jeter ");
Notice that when specifying the URL, the protocol (jdbc:as400:) is specified before the IP address. As mentioned
earlier, each DBMS will have a different protocol name and syntax for specifying the URL
Tutorial: Accessing an Oracle Database
You must first download the driver. As of this writing, Oracle offers the driver free and can be downloaded
http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html (see Figure 10-3 ). Follow
the links for downloading the driver that corresponds to the Oracle and JDK versions you are using. The arrow in
Figure 10-3 points at the driver for Oracle 11g Release 2. Double-click the correct driver for your Oracle system.
Figure 10-3.
 
Search WWH ::




Custom Search