Hi Tomáš,

Thank you for your enquiry. The jOOQ runtime library allows for using
standard javax.sql.DataSource instead of Connection. Just pass it to the
using method:

DSLContext create = DSL.using(dataSource, SQLDialect.MYSQL);


Surprisingly, this isn't possible right now using the jOOQ GenerationTool
API. I have created a feature request to implement this for jOOQ 3.8:
https://github.com/jOOQ/jOOQ/issues/4891

Just to be sure to get this right, how are you currently configuring the
code generator with Grails? Are you using the GenerationTool class for
programmatic configuration?

Cheers,
Lukas

2016-01-04 9:34 GMT+01:00 Tomáš Cigler <[email protected]>:

> Hi,
>
> I have defined datasources in differerent build environments in Grails
> configuration. Now I can use injected datasource in service for gathering
> connection and then instantiate
> DSLContext create = DSL.using(connection, SQLDialect.MYSQL)
>
> Is there a way that I can defaultly assign the datasource (maybe by some
> existing plugin or configuration) to DSL, from which it would take the
> connections itself and tell it that I want to always use MySQL dialect, so
> I can then omit
> using(connection, SQLDialect.MYSQL)
>
> Can I somehow use this datasource even for generator plugin, which
> generates POJOs, DAOs etc.?
>
> Thanks
> Tomáš
>
> --
> 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.

Reply via email to