最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

db2 - BasicDataSource not having property for clientProgramName - Stack Overflow

matteradmin5PV0评论

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;

Post a comment

comment list (0)

  1. No comments so far