Announcement Announcement Module
Collapse
No announcement yet.
what happens to the db connections after this call? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • what happens to the db connections after this call?

    I am passing the dburl value dynamically based on user's selection in my case.

    Code:
    dburl="jdbc:oracle:thin:@${dburl}"
            log.info "$dburl"
            def sql = Sql.newInstance("${dburl}",
                        "test", "test", "oracle.jdbc.OracleDriver")
            def selectEmpStatement="""
             select * from emp
           """
           
            List empListTemp= new ArrayList()
            sql?.eachRow(selectEmpStatement){
                empListTemp.add(it.empno)
            }
    what happens to the connection it created for fetching the data. Will it be taken care by the GORM or I have to close the connection?

    Thanks

  • #2
    As described here, you will have to manually close the connection via sql.close(). You are basically bypassing GORM.

    Comment

    Working...
    X