【问题标题】:java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbc1121 in java.library.pathjava.sql.SQLException:加载本机库/缺少方法时出现问题:java.library.path 中没有 ttJdbc1121
【发布时间】:2013-05-29 03:43:13
【问题描述】:

我在尝试连接到系统中配置的 timesten 数据库时遇到此错误: java.sql.SQLException:加载本机库/缺少方法时出现问题:java.library.path 中没有 ttJdbc1121

这是我的代码:

    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();
        }
    }

我在构建路径中使用 java 5 并附加了 ttjdbc5.jar。 有人可以帮忙吗?

【问题讨论】:

  • 需要将DLLttJDbc1121.dll的位置添加到java.library.path系统属性中
  • 是的...我检查了安装目录... ttJDbc1121.dll 丢失。我在互联网上搜索了这个 dll..但找不到任何地方
  • 它可能是 TimesTen 本身的一部分,而不是驱动程序的一部分,所以请看oracle.com/technetwork/products/timesten/downloads/index.html

标签: database eclipse jdbc timesten


【解决方案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);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-25
    • 1970-01-01
    • 2013-02-01
    • 1970-01-01
    • 2015-05-03
    • 2019-12-20
    • 1970-01-01
    相关资源
    最近更新 更多