The Artima Developer Community
Sponsored Link

Java Buzz Forum
Configuring Kodo inside Spring Part2

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Marc Logemann

Posts: 594
Nickname: loge
Registered: Sep, 2002

Marc Logemann is founder of www.logentis.de a Java consultancy
Configuring Kodo inside Spring Part2 Posted: Mar 11, 2005 5:48 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Marc Logemann.
Original Post: Configuring Kodo inside Spring Part2
Feed Title: Marc's Java Blog
Feed URL: http://www.logemann.org/day/index_java.xml
Feed Description: Java related topics for all major areas. So you will see J2ME, J2SE and J2EE issues here.
Latest Java Buzz Posts
Latest Java Buzz Posts by Marc Logemann
Latest Posts From Marc's Java Blog

Advertisement

This is a follow up to my previous blog. If you need control of the ConnectionPool provided by com.solarmetric.jdbc.PoolingDataSource, you just can create your own Pool and supply it to the PoolingDataSource like this:

   <bean id="dataSource" class="com.solarmetric.jdbc.PoolingDataSource">
    <constructor-arg>
      <ref local="connectionPool"/>
    </constructor-arg>
        <property name="connectionURL">
            <value>jdbc:mysql://localhost/somedb?useUnicode=true</value>
        </property>
        <property name="connectionDriverName">
            <value>com.mysql.jdbc.Driver</value>
        </property>
        <property name="connectionPassword">
            <value>root</value>
        </property>
        <property name="connectionUserName">
            <value>root</value>
        </property>
    </bean> 

You see, we use setter and constructor injection for providing the needed properties. The connectionPool can only be applied in the constructor in the Kodo DataSource.

Then we create our own ConnectionPool like this:

    <bean id="connectionPool" class="com.solarmetric.jdbc.ConnectionPoolImpl">
        <property name="maxActive">
            <value>10</value>
        </property>
        <property name="maxWait">
            <value>1000</value>
        </property>
    </bean> 

There are a lot more properties you can define, check the API documentation for ConnectionPoolImpl for more infos.

Read: Configuring Kodo inside Spring Part2

Topic: Has Sun Stepped up Desktop Java Marketing? Previous Topic   Next Topic Topic: JGoodies: Using the Button Builders

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use