Hello Przemysław,

This is an API flaw, which should be fixed. I have registered feature
request #2912 for this:
https://github.com/jOOQ/jOOQ/issues/2912

While it is possible to conveniently provide a Connection to the
DSL.using() method, there is no such convenience method in
DefaultConnection. You will have to manually wrap your JDBC Connection in a
DefaultConnectionProvider:
http://www.jooq.org/javadoc/latest/org/jooq/impl/DefaultConnectionProvider.html

Alternatively, you can write:

Configuration c = DSL.using(connection, SQLDialect.MYSQL)

                     .configuration();


Cheers
Lukas

2013/12/26 Przemysław Lewandowski <[email protected]>

> Hello
> Im trying to make use of generated DAO in JOOQ :) but it needs
> Configuration Object. I found something like this:
>
> *Configuration configuration = new
> DefaultConfiguration().set(connection).set(SQLDialect.MYSQL);*
>
> but compilator is telling me that it need *ConnectionProvider *:)
>
> this is how I create Connection Object:
>
> *Connection conn = null;*
>
> *String userName = "root";*
> *String password = "pass";*
> *String url = "jdbc:mysql://localhost:3306/library";*
> *Class.forName("com.mysql.jdbc.Driver").newInstance();*
> *conn = DriverManager.getConnection(url, userName, password);*
>
> Does Somebody know how to make it proper ?
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.

Reply via email to