Announcement Announcement Module
Collapse
No announcement yet.
How to config c3p0 datasource in spring? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to config c3p0 datasource in spring?

    Hi everyone:

    I use DBCP as my spring datasource before,but it seems that it has some bugs.So I want to change the datasource from DBCP to c3p0. I config the DBCP using the following code:
    Code:
    <bean id="MyDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <!-- results in a setDriverClassName&#40;String&#41; call -->
            <property name="driverClassName">
                <value>com.mysql.jdbc.Driver</value>
            </property>
            <property name="url">
                <value>jdbc&#58;mysql&#58;//localhost&#58;3306/webwork?useUnicode=true&amp;characterEncoding=gb2312</value>
            </property>
            <property name="username">
                <value>lyo</value>
            </property>
    		<property name="password">
                <value>lyo</value>
            </property>
    		
    		<property name="defaultAutoCommit"> 
                <value>true</value> 
            </property>
    		
        </bean>
    But how to config c3p0 datasource ? Thks!

  • #2
    There's a sample http://forum.springframework.org/showthread.php?t=13078.
    Last edited by robyn; May 16th, 2006, 03:21 AM.

    Comment


    • #3
      :)

      Originally posted by katentim
      It's a standard config. Thks! I will try it. ;-)
      Last edited by robyn; May 16th, 2006, 03:21 AM.

      Comment


      • #4
        Thanks katetim . You can also find a configuration inside the samples in Spring.

        Comment

        Working...
        X