<bean id="mysqlDataSource" class="com.mysql.jdbc.jdbc2.optional.
MysqlConnectionPoolDataSource">
<property name="url" value="jdbc:mysql://localhost:3306/root"/>
<property name="user" value="root"/>
<property name="password" value=""/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.datasources.
SharedPoolDataSource" destroy-method="close">
<property name="connectionPoolDataSource" ref="mysqlDataSource"/>
<property name="maxActive" value="20"/>
<property name="maxIdle" value="5"/>
<property name="maxWait" value="-1"/>
</bean>
<service ref="dataSource" interface="javax.sql.DataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/sample"/>
</service-properties>
</service>
<bean id="mysqlDataSource" class="com.mysql.cj.jdbc.MysqlConnectionPoolDataSource">
<property name="url" value="jdbc:mysql://localhost:3306/root"/>
<property name="user" value="root"/>
<property name="password" value=""/>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.datasources.
SharedPoolDataSource" destroy-method="close">
<property name="connectionPoolDataSource" ref="mysqlDataSource"/>
<property name="maxActive" value="20"/>
<property name="maxIdle" value="5"/>
<property name="maxWait" value="-1"/>
</bean>
<service ref="dataSource" interface="javax.sql.DataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/sample"/>
</service-properties>
</service>