How to connect JDBC to Oracle 8

Here is how to make Oracle 8 and JDBC work together on the Microsoft 98 platform.

Step 0: You must make a new database connection.

On oracle 8:

1. start the oracle navigator

2. right click the database connections folder.

3. select new

4. make your name and password the same as when you created the new service

5. in the connect field choose the service you created.

After this I strongly recommend launching oracle's ODBC test utility. If you set up your data source using Microsoft's ODBC admin tool you should be able to select it from the machine data sources menu. Specify user name and password and try to connect. (NOTE: to do this you must have your listener started and running) From this utility you can run queries on the database through ODBC to see if it is working correctly.

Step 1: Follow the link to oracle 8i, It says it is for oracle 8i but is practically the same for po8.

Step 2: LSNRCTL is located in [ORACLE_HOME]\bin and is really called LSNRCTL80 this is important because before every time you restart your machine you must run this program.

Step 3: Register a data source using the Microsoft ODBC data Source admin tool make sure the service name is the same as the one you created in step 1.

Step 4: Go to oracle's website and download the drivers (the 8i drivers will work on PO8) specifically you want classes12.zip and the other zip files associated with it - you'll see when you get on line - put these in your java classpath.

Step 5: Open your java program. When you load the driver the 1st thing you should do is:

DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());

They say only do this once but leaving it there seems ok.

Step 6: Now connect to the database - here is an example:

cn = DriverManager.getConnection
("jdbc:oracle:thin:@JGENNARI:1521:orcl","scott","tiger");

(where cn is a Connection)

the connection string has the following sections:
(I used the thin driver because it supports TCP/IP and is recommend for
web apps)

jdbc:oracle:thin:@HOST:PORT:SID, username, password

HOST - is the DNS name you set up in step one - I am
assuming you can substitute localhost but I haven't tried it

PORT is the port of the service you specified

SID - is the SID of the database

that's about it.

Using the JSWDK 1.0.1 web server it works well.

(contributor: Jeff Gennari)