Results 1 to 2 of 2

Thread: MappingSqlQuery Connection

  1. #1

    Default MappingSqlQuery Connection

    I am using MappingSqlQuery to execute a query, but inside the method
    protected Object mapRow(ResultSet rs, int rownum) that I need to implement, I would like to get the same Connection that created the rs.

    I get the dataSource from JdbcTemplate, but if I do
    DataSourceUtils.getConnection(dataSource) I will get another connection, won't I ?
    besides I have to worry to close the connection, I borrow two connection from poll unnecessarily.

    Does somebody have a suggestion ?

  2. #2
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    try using rs.getStatement().getConnection() - it should return the active connection that is used.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Connection closed after transaction commit
    By alirussi in forum Data
    Replies: 4
    Last Post: Dec 17th, 2011, 06:41 AM
  2. Replies: 4
    Last Post: Aug 2nd, 2005, 02:57 AM
  3. Replies: 6
    Last Post: May 25th, 2005, 01:56 AM
  4. Calling procedure when connection is 'got'
    By mlythgoe in forum Data
    Replies: 10
    Last Post: May 6th, 2005, 04:01 AM
  5. Replies: 7
    Last Post: Apr 15th, 2005, 08:43 PM

Posting Permissions

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