org.midao.jdbc.spring.exception
Class SpringExceptionHandler

java.lang.Object
  extended by org.midao.jdbc.spring.exception.SpringExceptionHandler
All Implemented Interfaces:
ExceptionHandler

public class SpringExceptionHandler
extends java.lang.Object
implements ExceptionHandler

Exception handler implementation inspired by Spring JDBC implementation


Constructor Summary
SpringExceptionHandler(java.lang.String dbName)
          Creates new SpringExceptionHandler instance.
 
Method Summary
 MidaoSQLException convert(java.sql.Connection conn, java.sql.SQLException cause, java.lang.String sql, java.lang.Object... params)
          Converts SQLException into MidaoSQLException while populating it with query parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringExceptionHandler

public SpringExceptionHandler(java.lang.String dbName)
Creates new SpringExceptionHandler instance.

Parameters:
dbName - Database name
Method Detail

convert

public MidaoSQLException convert(java.sql.Connection conn,
                                 java.sql.SQLException cause,
                                 java.lang.String sql,
                                 java.lang.Object... params)
Converts SQLException into MidaoSQLException while populating it with query parameters

Specified by:
convert in interface ExceptionHandler
Parameters:
conn - SQL Connection which is used in current session. Is not guaranteed to be open
cause - original SQL Exception
sql - SQL string which was executed
params - parameters which were supplied to the query
Returns:
filled MidaoSQLException


Copyright © 2013. All Rights Reserved.