3

这是我在 tomcat 的 localhost 文件夹中的 NXYTEST.xml

<Context path="/test" reloadable="true" docBase="D:\Development\workspace\NXYTEST\WebContent" workDir="D:\Development\workspace\NXYTEST\work">
    <Resource auth="Container" driverClassName="com.ibm.db2.jcc.DB2Driver" maxActive="20" maxIdle="10" maxWait="-1" name="jdbc/ebank_ds" password="abc123" type="javax.sql.DataSource" url="jdbc:db2://172.31.17.114:60012/TESTDB" username="con2nns" />
</Context>

我的项目启动并获得数据库连接,但出现如下错误:

DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: CON2NNS.PUB_APPPAR caused by: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: CON2NNS.PUB_APPPAR cause: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: CON2NNS.PUB_APPPAR

我想将“testschema”设置为默认架构,请帮助我,谢谢...

4

1 回答 1

6

您应该能够添加url=到此字符串的末尾:

:currentSchema=MySchema;

所以,你的最终看起来像:

jdbc:db2://172.31.17.114:60012/TESTDB:currentSchema=testschema;
于 2012-05-25T12:56:11.033 回答