Well there are actually two ways. I am not sure which one exactly you are asking about. If you are talking about Java code accessing an Oracle Database, JDBC, then you need an Oracle JDBC driver. You can find them at Oracle's website. Try to get the thin driver, this will use Oracle's client software with tnsnames, which will be the fastest.
As far as the other way to use Java with Oracle, you can create Stored Procedures in Oracle written in Java. They have a package for "Linking" the Java class to Oracle. I can't find a specific link to give you right now though, so you will have to search for it.
Not that you asked this, but check out Tom's answer at the bottom of his take on Java and Oracle.
Here. Mark