Example usage for org.springframework.jdbc.support SQLErrorCodeSQLExceptionTranslator setDataSource

List of usage examples for org.springframework.jdbc.support SQLErrorCodeSQLExceptionTranslator setDataSource

Introduction

In this page you can find the example usage for org.springframework.jdbc.support SQLErrorCodeSQLExceptionTranslator setDataSource.

Prototype

public void setDataSource(DataSource dataSource) 

Source Link

Document

Set the DataSource for this translator.

Usage

From source file:es.galvarez.rest.config.SpringConfiguration.java

@Bean(name = "jdbcExceptionTranslator")
public SQLErrorCodeSQLExceptionTranslator jdbcExceptionTranslator() {
    SQLErrorCodeSQLExceptionTranslator exceptionTranslator = new SQLErrorCodeSQLExceptionTranslator();
    exceptionTranslator.setDataSource(configureDataSource());
    return exceptionTranslator;
}