本文整理汇总了Java中org.springframework.jdbc.support.SQLExceptionTranslator.translate方法的典型用法代码示例。如果您正苦于以下问题:Java SQLExceptionTranslator.translate方法的具体用法?Java SQLExceptionTranslator.translate怎么用?Java SQLExceptionTranslator.translate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.jdbc.support.SQLExceptionTranslator
的用法示例。
在下文中一共展示了SQLExceptionTranslator.translate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translate
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
private DataAccessException translate(ExecuteContext context,
SQLExceptionTranslator translator, SQLException exception) {
return translator.translate("jOOQ", context.sql(), exception);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:JooqExceptionTranslator.java
示例2: convertJdbcAccessException
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
protected DataAccessException convertJdbcAccessException(JDBCException ex, SQLExceptionTranslator translator) {
String msg = ex.getMessage();
String sql = ex.getSQL();
SQLException sqlException = ex.getSQLException();
return translator.translate("Hibernate operation: " + msg, sql, sqlException);
}
示例3: convertJdbcAccessException
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
/**
* Convert the given SQLException to an appropriate exception from the
* {@code org.springframework.dao} hierarchy. Can be overridden in subclasses.
* <p>Note that a direct SQLException can just occur when callback code
* performs direct JDBC access via {@code Session.connection()}.
* @param ex the SQLException
* @return the corresponding DataAccessException instance
* @see #setJdbcExceptionTranslator
*/
protected DataAccessException convertJdbcAccessException(SQLException ex) {
SQLExceptionTranslator translator = getJdbcExceptionTranslator();
if (translator == null) {
translator = getDefaultJdbcExceptionTranslator();
}
return translator.translate("Hibernate-related JDBC operation", null, ex);
}
示例4: convertJdbcAccessException
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
/**
* Convert the given SQLException to an appropriate exception from the {@code org.springframework.dao} hierarchy. Can be overridden in subclasses.
* <p>
* Note that a direct SQLException can just occur when callback code performs direct JDBC access via {@code Session.connection()}.
*
* @param ex the SQLException
* @return the corresponding DataAccessException instance
* @see #setJdbcExceptionTranslator
*/
private DataAccessException convertJdbcAccessException(final SQLException ex) {
SQLExceptionTranslator translator = getJdbcExceptionTranslator();
if (translator == null) {
translator = getDefaultJdbcExceptionTranslator();
}
return translator.translate("Hibernate-related JDBC operation", null, ex);
}
示例5: convertJdbcAccessException
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
/**
* Convert the given SQLException to an appropriate exception from the
* <code>org.springframework.dao</code> hierarchy. Can be overridden in subclasses.
* <p>Note that a direct SQLException can just occur when callback code
* performs direct JDBC access via <code>Session.connection()</code>.
* @param ex the SQLException
* @return the corresponding DataAccessException instance
* @see #setJdbcExceptionTranslator
* @see org.hibernate.Session#connection()
*/
protected DataAccessException convertJdbcAccessException(SQLException ex) {
SQLExceptionTranslator translator = getJdbcExceptionTranslator();
if (translator == null) {
translator = getDefaultJdbcExceptionTranslator();
}
return translator.translate("Hibernate-related JDBC operation", null, ex);
}
示例6: convertJdbcAccessException
import org.springframework.jdbc.support.SQLExceptionTranslator; //导入方法依赖的package包/类
/**
* Convert the given Hibernate JDBCException to an appropriate exception
* from the {@code org.springframework.dao} hierarchy, using the
* given SQLExceptionTranslator.
* @param ex Hibernate JDBCException that occurred
* @param translator the SQLExceptionTranslator to use
* @return a corresponding DataAccessException
*/
protected DataAccessException convertJdbcAccessException(JDBCException ex, SQLExceptionTranslator translator) {
return translator.translate("Hibernate flushing: " + ex.getMessage(), ex.getSQL(), ex.getSQLException());
}