Package io.debezium.jdbc
Class JdbcConnectionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.debezium.jdbc.JdbcConnectionException
-
- All Implemented Interfaces:
Serializable
public final class JdbcConnectionException extends RuntimeException
RuntimeExceptionwhich is raised for variousSQLExceptioninstances and which retains the error code from the original exception.- Author:
- Horia Chiorean (hchiorea@redhat.com)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private interrorCodeprivate static longserialVersionUIDprivate StringsqlState
-
Constructor Summary
Constructors Constructor Description JdbcConnectionException(String message, SQLException e)Creates a new exception instance, wrapping the supplied SQLException with a custom messageJdbcConnectionException(SQLException e)Creates a new exception instance, wrapping the supplied SQLException
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetErrorCode()Returns the SQL error code from the original exceptionStringgetSqlState()Returns the SQL state from the original exception-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
sqlState
private final String sqlState
-
errorCode
private final int errorCode
-
-
Constructor Detail
-
JdbcConnectionException
public JdbcConnectionException(SQLException e)
Creates a new exception instance, wrapping the supplied SQLException- Parameters:
e- aSQLExceptioninstance, may not be null
-
JdbcConnectionException
public JdbcConnectionException(String message, SQLException e)
Creates a new exception instance, wrapping the supplied SQLException with a custom message- Parameters:
message- the exception message, may not be nulle- aSQLExceptioninstance, may not be null
-
-
Method Detail
-
getSqlState
public String getSqlState()
Returns the SQL state from the original exception- Returns:
- the SQL state string
- See Also:
SQLException.getSQLState()
-
getErrorCode
public int getErrorCode()
Returns the SQL error code from the original exception- Returns:
- the SQL error code
- See Also:
SQLException.getErrorCode()
-
-