Announcement Announcement Module
Collapse
No announcement yet.
MappingSqlQuery Connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    try using rs.getStatement().getConnection() - it should return the active connection that is used.

    Comment

    Working...
    X