最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

db2 - BasicDataSource not having property for clientProgramName - Stack Overflow

programmeradmin0浏览0评论

In my application we are creating connection pool as shown below

<bean id="dataSource" class=".apachemons.dbcp.BasicDataSource"
destroy-method="close" driverClassName="com.ibm.db2.jcc.DB2Driver"
url="" username="" password="" clientProgramName="JavaClientApp"/>

As per this article, we are trying to set "clientProgramName", but is not working.

We also tried

connectionProperties="clientProgramName='JavaClientApp'"

Same configuration is working fine if i use com.ibm.db2.jcc.DB2SimpleDataSource instead of BasicDataSource but DB2SimpleDataSource does not have connection pool. We want to have connection pool and clientProgramName both.

In my application we are creating connection pool as shown below

<bean id="dataSource" class=".apachemons.dbcp.BasicDataSource"
destroy-method="close" driverClassName="com.ibm.db2.jcc.DB2Driver"
url="" username="" password="" clientProgramName="JavaClientApp"/>

As per this article, we are trying to set "clientProgramName", but is not working.

We also tried

connectionProperties="clientProgramName='JavaClientApp'"

Same configuration is working fine if i use com.ibm.db2.jcc.DB2SimpleDataSource instead of BasicDataSource but DB2SimpleDataSource does not have connection pool. We want to have connection pool and clientProgramName both.

Share Improve this question edited Nov 19, 2024 at 5:19 James Z 12.3k10 gold badges27 silver badges47 bronze badges asked Nov 18, 2024 at 21:32 SanjaySanjay 3133 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I was able to resolve this issue by updating the url as showm below.

jdbc:db2://<host>:<port>/<DB>:currentSchema=<schema>;clientProgramName=MyApp;

发布评论

评论列表(0)

  1. 暂无评论