Hello Martin,
You can use jOOQ without JdbcTemplate and
SpringExceptionTranslationExecuteListener.
Just create DSLContextImpl in spring context and use it into your service
class.
Below you and find example how to initialize DSLContext instance in spring
context.
Unfortunately we found DefaultConfiguration deprecated in jOOQ 3.0.
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
init-method="createDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
[...]
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="transactionAwareDataSource"
class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
<constructor-arg ref="dataSource"/>
</bean>
<bean id="*jooqContext*" class="org.jooq.impl.DSLContextImpl">
<constructor-arg name="configuration" ref="config"/>
</bean>
<bean class="org.jooq.impl.DataSourceConnectionProvider"
name="connectionProvider">
<constructor-arg ref="transactionAwareDataSource"/>
</bean>
<bean class="org.jooq.impl.DefaultConfiguration" name="config">
<constructor-arg name="connectionProvider" ref="connectionProvider"/>
<constructor-arg name="dialect">
<value type="org.jooq.SQLDialect">ORACLE</value>
</constructor-arg>
<constructor-arg name="listenerProviders">
<list>
<bean class="org.jooq.impl.DefaultExecuteListenerProvider">
<constructor-arg name="listener">
<bean class="com.example.*
YourCustomSqlExceptionTransformer*"/>
</constructor-arg>
</bean>
</list>
</constructor-arg>
<constructor-arg name="settings">
<bean class="org.jooq.conf.Settings">
<property name="renderMapping">
<bean class="org.jooq.conf.RenderMapping">
<property name="defaultSchema" value="${db.schema}"/>
<property name="schemata">
<list>
<bean class="org.jooq.conf.MappedSchema">
<property name="input"
value="YOUR_PROJECT_SCHEMA_NAME"/>
<property name="output"
value="${db.schema}"/>
</bean>
</list>
</property>
</bean>
</property>
</bean>
</constructor-arg>
<constructor-arg name="data">
<null/>
</constructor-arg>
</bean>
On Wed, Jun 12, 2013 at 12:34 AM, <[email protected]> wrote:
> So is there somewhere an updated version of the
> SpringExceptionTranslationExecuteListener
> and any supporting classes that was shown in the "A nice way of using jOOQ
> with Spring" blog entry that can be downloaded? I am just starting out
> experimenting with jOOQ and proper integration with Spring's transaction
> management is mandatory.
>
> I found a few Gist pages by azell but could not find the complete classes.
>
> The way things stand right now, I think I could only use jOOQ for help in
> construction SQL String generation that I can then use with Spring's
> JdbcTemplate. This is not quite optimal; but at least would be a start.
>
> Thanks for what looks like a GREAT libary.
>
> Martin Bosak
>
> --
> 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.