1

I am getting this error while trying to connect to timesten DB configured in my system: java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.path

Here is my code:

    try {
        Class.forName("com.timesten.jdbc.TimesTenDriver");
        conn = DriverManager
                .getConnection("jdbc:timesten:direct:dsn=TT_Alias");
        System.out.println(conn);
    } catch (ClassNotFoundException e) {
        e.printStackTrace();
    } catch (SQLException e) {
        e.printStackTrace();
    }
    finally {
        try {
            if(conn != null) {
                conn.close();
            }
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

I am using java 5 & attached ttjdbc5.jar in the build path. can someone help please?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
user1407668
  • 587
  • 5
  • 20
  • 35
  • You need to add the location of the DLL `ttJDbc1121.dll` to the java.library.path system property – Mark Rotteveel May 29 '13 at 06:27
  • yes... I checked the installation directory... ttJDbc1121.dll is missing. I searched in internet for this dll..But couldnt find anywhere – user1407668 May 30 '13 at 04:22
  • It might be part of TimesTen itself, not of the driver, so look at http://www.oracle.com/technetwork/products/timesten/downloads/index.html – Mark Rotteveel May 30 '13 at 07:05

1 Answers1

1
ttJdbcCS1122.dll is in bin folder of TimesTen home please copy that to lib folder, now start running you program it will work if rest of configuration is correct.



// /JDBC Driver
static final String JDBC_DRIVER = “com.timesten.jdbc.TimesTenDriver”;
static final String DB_URL = “jdbc:timesten:client:TTC_Server=serverIp;TTC_Server_DSN=DSN;TCP_PORT=PortNo”;

// DB Credential
static final String username = “***”;
static final String password = “****”;

System.out.println(“Registering database …”);
Class.forName(JDBC_DRIVER);

//Connecting to db
System.out.println(“Connecting to database …”);
conn = DriverManager.getConnection(DB_URL, username, password);
NightStrom
  • 11
  • 4