我试图使用JDBC查询NonStop SQL/MX数据库。我有正确的驱动程序和我设法连接到数据库,并初始化代码如下的语句(我发现here):由于不存在目录导致JDBC数据库连接失败
Class.forName("com.tandem.t4jdbc.SQLMXDriver");
Connection con = DriverManager.getConnection(url, user, password);
Statement stmt = con.createStatement();
然而,我无法执行查询...
ResultSet rs = stmt.executeQuery("SELECT * FROM Table1");
...因为某些不存在的目录NONSTOP_SYSTEM_NSK
。那是什么意思?在GUI中查看同一个数据库时,我不需要指定任何目录(例如,DB Visualizer)。
产生的堆栈跟踪看起来是这样的:
java.sql.SQLException: *** ERROR[1002] Catalog NONSTOP_SYSTEM_NSK does
not exist or has not been registered on node \NSK01.
at com.tandem.t4jdbc.SQLMXMessages.throwSQLException(SQLMXMessages.java:71)
at com.tandem.t4jdbc.InterfaceStatement.executeDirect(InterfaceStatement.java:545)
at com.tandem.t4jdbc.SQLMXStatement.executeQuery(SQLMXStatement.java:226)