Package org.mariadb.jdbc.util.exceptions
Class ExceptionFactory
- java.lang.Object
-
- org.mariadb.jdbc.util.exceptions.ExceptionFactory
-
- Direct Known Subclasses:
ExceptionFactory.SqlExceptionFactory
public class ExceptionFactory extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classExceptionFactory.SqlExceptionFactory
-
Field Summary
Fields Modifier and Type Field Description private Configurationconfprivate Connectionconnectionprivate HostAddresshostAddressprivate static java.util.Set<java.lang.Integer>LOCK_DEADLOCK_ERROR_CODESprivate MariaDbPoolConnectionpoolConnectionprivate java.sql.Statementstatementprivate longthreadId
-
Constructor Summary
Constructors Modifier Constructor Description ExceptionFactory(Configuration conf, HostAddress hostAddress)privateExceptionFactory(Connection connection, MariaDbPoolConnection poolConnection, Configuration conf, HostAddress hostAddress, long threadId, java.sql.Statement statement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringbuildMsgText(java.lang.String initialMessage, long threadId, Configuration conf, java.lang.String sql, int errorCode, Connection connection)java.sql.SQLExceptioncreate(java.lang.String message)java.sql.SQLExceptioncreate(java.lang.String message, java.lang.String sqlState)java.sql.SQLExceptioncreate(java.lang.String message, java.lang.String sqlState, int errorCode)java.sql.SQLExceptioncreate(java.lang.String message, java.lang.String sqlState, java.lang.Exception cause)java.sql.BatchUpdateExceptioncreateBatchUpdate(java.util.List<Completion> res, int length, int[] responseMsg, java.sql.SQLException sqle)java.sql.BatchUpdateExceptioncreateBatchUpdate(java.util.List<Completion> res, int length, java.sql.SQLException sqle)private java.sql.SQLExceptioncreateException(java.lang.String initialMessage, java.lang.String sqlState, int errorCode, java.lang.Exception cause)java.lang.StringgetSql()java.sql.SQLExceptionnotSupported(java.lang.String message)ExceptionFactoryof(java.sql.Statement statement)ExceptionFactorysetConnection(Connection connection)voidsetConnection(ExceptionFactory oldExceptionFactory)ExceptionFactorysetPoolConnection(MariaDbPoolConnection internalPoolConnection)voidsetThreadId(long threadId)ExceptionFactorywithSql(java.lang.String sql)
-
-
-
Field Detail
-
LOCK_DEADLOCK_ERROR_CODES
private static final java.util.Set<java.lang.Integer> LOCK_DEADLOCK_ERROR_CODES
-
conf
private final Configuration conf
-
hostAddress
private final HostAddress hostAddress
-
connection
private Connection connection
-
poolConnection
private MariaDbPoolConnection poolConnection
-
threadId
private long threadId
-
statement
private java.sql.Statement statement
-
-
Constructor Detail
-
ExceptionFactory
public ExceptionFactory(Configuration conf, HostAddress hostAddress)
-
ExceptionFactory
private ExceptionFactory(Connection connection, MariaDbPoolConnection poolConnection, Configuration conf, HostAddress hostAddress, long threadId, java.sql.Statement statement)
-
-
Method Detail
-
buildMsgText
private static java.lang.String buildMsgText(java.lang.String initialMessage, long threadId, Configuration conf, java.lang.String sql, int errorCode, Connection connection)
-
setConnection
public void setConnection(ExceptionFactory oldExceptionFactory)
-
setConnection
public ExceptionFactory setConnection(Connection connection)
-
setPoolConnection
public ExceptionFactory setPoolConnection(MariaDbPoolConnection internalPoolConnection)
-
setThreadId
public void setThreadId(long threadId)
-
createBatchUpdate
public java.sql.BatchUpdateException createBatchUpdate(java.util.List<Completion> res, int length, java.sql.SQLException sqle)
-
createBatchUpdate
public java.sql.BatchUpdateException createBatchUpdate(java.util.List<Completion> res, int length, int[] responseMsg, java.sql.SQLException sqle)
-
of
public ExceptionFactory of(java.sql.Statement statement)
-
withSql
public ExceptionFactory withSql(java.lang.String sql)
-
createException
private java.sql.SQLException createException(java.lang.String initialMessage, java.lang.String sqlState, int errorCode, java.lang.Exception cause)
-
notSupported
public java.sql.SQLException notSupported(java.lang.String message)
-
create
public java.sql.SQLException create(java.lang.String message)
-
create
public java.sql.SQLException create(java.lang.String message, java.lang.String sqlState)
-
create
public java.sql.SQLException create(java.lang.String message, java.lang.String sqlState, java.lang.Exception cause)
-
create
public java.sql.SQLException create(java.lang.String message, java.lang.String sqlState, int errorCode)
-
getSql
public java.lang.String getSql()
-
-