English 中文(简体)
如何在 Tomcat s apap 上下文中设置默认 db smama 默认 db smama
原标题:How to set default db schema in tomcat s app context
  • 时间:2012-05-25 06:32:21
  •  标签:
  • tomcat
  • db2

这是我在Tomcat 本地主机文件夹中的 NXYTEST. xml

<Context path="/test" reloadable="true" docBase="D:DevelopmentworkspaceNXYTESTWebContent" workDir="D:DevelopmentworkspaceNXYTESTwork">
    <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>

我的项目启动并获得 db 连接, 但这样的错误 :

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"设为默认的预设方案, 帮我,谢谢...

最佳回答

您应该能够将此字符串添加到 url/code> 结尾处 :

:currentSchema=MySchema;

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

jdbc:db2://172.31.17.114:60012/TESTDB:currentSchema=testschema;
问题回答

暂无回答




相关问题
Tomcat´s server.xml dynamic configuration

My web application uses the same database configuration as the application XYZ. I have a resource declaration for a context in server.xml, so I have a duplicated configuration (once for web ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...