Answer the question
In order to leave comments, you need to log in
How to translate from xml to Annotation?
how to translate below code into connection code with annotation?
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
Answer the question
In order to leave comments, you need to log in
@Bean
public PlatformTransactionManager transactionManager(){
return new DataSourceTransactionManager(datasource());
}
@Bean
public DataSource datasource(){
return new OracleDataSource(); //настройте свой datasource тут
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question