Check if the directories described in the following table have been created and populated in the ORACLE_HOME
directory.
Table 2-1 Directories and Files in the ORACLE_HOME Directory
Directory | Description |
---|---|
|
The |
|
This file contains late-breaking and release-specific information about the drivers, which may not have been included in other documentation on the product. |
|
This directory contains the |
Note:
Use the ojdbcn.jar
file (where 'n' is the release number) supplied with Oracle Database Installation Guide or Oracle Database Client Installation Guide.
This section describes the environment variables that must be set for the JDBC Thin Driver. You must set the classpath for your installed JDBC Thin Driver. For JDK 8, you must set the following values for the CLASSPATH
variable:
ORACLE_HOME
/jdbc/lib/ojdbc8.jar
ORACLE_HOME
/jlib/orai18n.jar
Ensure that there is only one JDBC class file, such as ojdbc8.jar
, and one globalization classes file, orai18n.jar
, in the CLASSPATH
variable.
Starting from Oracle Database 12c Release 2 (12.2), you can get details about the JDBC support in the database as follows:
> java -jar ojdbc6.jar Oracle 12.1.0.0. JDBC 4.0 compiled with JDK6
In addition, you can determine the version of the JDBC driver that you installed by calling the getDriverVersion
method of the OracleDatabaseMetaData
class.
Note:
The JDBC Thin Driver requires a TCP/IP listener to be running on the computer where the database is installed.
Example 2-1 illustrates how to determine the driver version:
Example 2-1 Determining the JDBC Driver Version
import java.sql.*; import oracle.jdbc.*; import oracle.jdbc.pool.OracleDataSource; class JDBCVersion { public static void main (String args[]) throws SQLException { OracleDataSource ods = new OracleDataSource(); ods.setURL("jdbc:oracle:thin:hr/hr@localhost:1521/oracle"); Connection conn = ods.getConnection(); // Create Oracle DatabaseMetaData object DatabaseMetaData meta = conn.getMetaData(); // gets driver info: System.out.println("JDBC driver version is " + meta.getDriverVersion()); } }