Sql instance can either be created with the constructors taking Connection or DataSource as parameters or via static methods newInstance or withInstance, the latetr which can a variety of String parameters.

What I am wondering is why newInstance & withInstance cannot also take a Connection or a DataSource. It would be nice to simply do something like.

   Sql.withInstance( myPool.getConnection() ) { sql ->

        // do stuff with sql here

   } // and sql.close() gets call upon closure exit, handing connection
   back to pool.

Just asking ...

--
Schalk W. Cronjé
Twitter / Ello / Toeter : @ysb33r

Reply via email to