admin管理员组

文章数量:1026989

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;

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;

本文标签: db2BasicDataSource not having property for clientProgramNameStack Overflow