2

I am going to connect to Oracle timesten database inside java application. For this purpose I wrote a simple connection class. When I try to run this java class an error " Problems with loading native library/missing methods: no ttJdbcCS in java.library.path" appeared. I tried to set LD_LIBRARY_PATH and java.library.path separately but the problem still exists! Here is the source code of sample class:

import java.beans.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.timesten.jdbc.TimesTenConnection;
import com.timesten.jdbc.TimesTenDataSource;

public class TTSimpleConnection {
    public static void main(String args[]) {
        try {
            TimesTenDataSource ttds = new TimesTenDataSource();
            ttds.setUrl("jdbc:timesten:client:dsn=temptsn;UID=*****;PWD=*****");
            TimesTenConnection ttcon = (TimesTenConnection) ttds
                    .getConnection();
            Statement stmt = (Statement) ttcon.createStatement();
            ResultSet rset = ((java.sql.Statement) stmt)
                    .executeQuery("select * from t");
            while (rset.next()) {
                System.out.println(rset.getInt(1));

            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
Ali
  • 1,759
  • 2
  • 32
  • 69

1 Answers1

0

Thanks for your simple example for Timesten DB! I use next method. Create maven app.

Insert jdbc driver in my local rep.: $ mvn install:install-file -Dfile=ttjdbc7.jar -DgroupId=com.oracle -DartifactId=ttjdbc7 -Dversion=7 -Dpackaging=jar -DgeneratePom=true

Added dependency in project, and rename: import **java.sql.**Statement;

Anton
  • 21
  • 2