Oracle has two types of JDBC driver:
a. the thin driver
b. the OCI (Oracle Call Interface) driver, which works through SQL*Net (or Oracle*Net or whatever they are calling it this week ).
The OCI driver needs the tnsnames.ora and your .so files (which represent the client side of SQL*Net) on the client and a database listener setup on the server. The thin driver just hits the database direct via a TCP/IP socket. You specify this in your connect string, e.g.:
Code:
jdbc:oracle:thin:@serverName:1521:dbName
All you need for a thin driver to work is the JAR file for the JDBC driver on your classpath. The .so files, LD_LIBRARY_PATH, etc. are not required for the thin driver.
For example, in TestJdbc.java:
Code:
import oracle.jdbc.pool.OracleDataSource;
public class TestJdbc {
public static void main(String ... args) {
System.out.println(OracleDataSource.class.getName());
}
}
$ javac -cp ojdbc6.jar TestJdbc.java
$ java -cp ojdbc6.jar:. TestJdbc
oracle.jdbc.pool.OracleDataSource
Hope that helps. I don't have an Oracle database around to show a more complete example. If you are still stuck, maybe post the code that's the problem?
Bookmarks