Hello, Thanks for your message. Indeed, that's what you should do. Here are some further hints:
A DataSource is a common abstraction that hides away the creation and management of JDBC Connections. Connection pools use this abstraction to implement the pool semantics. Clients will block on the DataSource.getConnection() call, once the pool is exhausted, until a Connection becomes free again via Connection.close() (at least, that's how it's usually implemented). jOOQ has its own abstraction to help users inject their Connection management lifecycle: The ConnectionProvider. When jOOQ needs a Connection (a query is executed), it gets the Connection from ConnectionProvider.acquire(). When jOOQ has finished with the Connection, it returns it to ConnectionProvider.release(). The DataSourceConnectionProvider bridges the jOOQ semantics to the common DataSource semantics. With Hikari, you can simply do, for example: DSL.using(hikariDataSouce, SQLDialect.H2) // H2 as an example .selectOne() .fetch(); or, more verbosely: DSL.using(new DataSourceConnectionProvider(hikariDataSouce), SQLDialect.H2) .selectOne() .fetch(); Hope this helps Lukas 2016-01-20 19:03 GMT+01:00 <[email protected]>: > Hi guys, > > I'm looking for use jooq with HikariCP but im a beginer with that 2 > projects. > So is something able to link me a tutorial or examples for this ? > > I saw that Jooq has DatasourceConnectionProvider(DataSource source) but > how to use it ? I'm confused, should i put my HikariCP Datasource into this > constructor ? And then ? > > Thank you > > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
