Results 1 to 2 of 2

Thread: DriverManagerDataSource close method

  1. #1
    Join Date
    Apr 2008
    Posts
    5

    Default DriverManagerDataSource close method

    Hello,

    When I'm having the DriverManagerDataSource in bean configuration xml and managed by Spring IDE, eclipse always indicate destroy-method="close" is an error with the following message:

    Destroy-method 'close' not found in bean class 'org.springframework.jdbc.datasource.DriverManager DataSource'

    Here is the bean definition:
    Code:
    <bean id="dataSource"
    	class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    	destroy-method="close">
    	<property name="driverClassName"
    		value="${jdbc.driverClassName}" />
    	<property name="url" value="${jdbc.url}" />
    	<property name="username" value="${jdbc.username}" />
    	<property name="password" value="${jdbc.password}" />
    </bean>
    So, is the close() destroy method really not needed?

    Thanks.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    It isn't. I suggest you read up on what the function of the destroy-method is, it is clearly explained in the reference guide.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •