java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.path

When trying to execute a Java program that connects to remote Oracle TimesTen database you receive the following stack trace.

C:\app\oracle\product\Middleware\jdk160_14_R27.6.5-32\bin\javaw.exe -server -classpath E:\source\java\jdeveloper\TimeTenConnectionTesting\Client\classes;C:\app\oracle\product\TimesTen\tt1121_64\lib\ttjdbc6.jar\app\oracle\product\Middleware\wlserver_10.3\server\lib\DemoTrust.jks com.oracledistilled.timesten.client.TTSimpleConnection
java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.path
	at com.timesten.jdbc.JdbcOdbcConnection.connect(
	at com.timesten.jdbc.TimesTenDataSource.getConnection(
	at com.oracledistilled.timesten.client.TTSimpleConnection.main(
Process exited with exit code 0.

The machine running the program has the Oracle TimesTen client installed and a Client DSN has been configured for the remote database.

In this example the JDBC driver is not able to find the correct native library. Looking at the Java code we see the following code segment is used to make the connection.

    try {
      // connect to TimesTen database
      TimesTenDataSource ttds = new TimesTenDataSource();
      TimesTenConnection ttcon = (TimesTenConnection) ttds.getConnection();

Notice that the URL is attempting a direct connection. In Oracle TimesTen there are two types of connections Direct and Client. Direct connections are intended to be made from applications running on the same server as the TimesTen Database. Client connections are connections from applications running on the database server or on remote machines.

The OracleTimes Client install does not have the native libraries required to make a direct connection. To resolve this error change the JDBC URL jdbc:timesten:direct:dsn=sample;UID=odtest;PWD=password from to jdbc:timesten:client:dsn=sample;UID=odtest;PWD=password .

Note: Direct is the default connection type so the URL may look like the following.


  • Pushkar (September 2, 2014 8:56 am)

    I am still getting this exception even if I am using jdbc:timesten:client:dsn.
    What may be the cause?

Post A Comment