简体   繁体   English

java.sql.SQLException:加载本机库/缺少方法时出现问题:java.library.path中没有ttJdbc1121

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

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 尝试连接到系统中配置的时间戳数据库时出现此错误:java.sql.SQLException:加载本机库/丢失方法时出现问题:java.library.path中没有ttJdbc1121

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. 我在构建路径中使用Java 5和附加的ttjdbc5.jar。 can someone help please? 有人可以帮忙吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.sql.SQLException:无法启动数据库 - java.sql.SQLException: Failed to start database java.lang.NumberFormatException:ForInputString“ 7110332507339” java.sql.SQLException:在Index :: 4处缺少IN或OUT参数 - java.lang.NumberFormatException: ForInputString“7110332507339” java.sql.SQLException: Missing IN or OUT Parameter at Index::4 在 CentOS8.2 上安装 oracle 18c 时如何设置 java.library.path? - How to set java.library.path when install oracle 18c on CentOS8.2? java.sql.SQLException:使用MS Access数据库找不到数据 - java.sql.SQLException: No data found with MS Access database java.sql.SQLException:在SWT中使用时数据库被锁定 - java.sql.SQLException: database is locked while using in SWT Phpstorm数据库:java.sql.SQLException:通信链接失败 - Phpstorm Database : java.sql.SQLException: Communications link failure 响应消息:java.sql.SQLException:在jMeter中找不到名称为:的池 - Response message: java.sql.SQLException: No pool found named: in jMeter java.sql.SQLException: 未知的系统变量 'tx_isolation' - java.sql.SQLException: Unknown system variable 'tx_isolation' 如何修复未处理的异常:引发sqle的java.sql.SQLException - How to fix Unhandled exception: java.sql.SQLException for throw sqle java.sql.SQLException:未找到适合于netbeans的驱动程序 - java.sql.SQLException: No suitable driver found for netbeans
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM