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 class
ExceptionFactory.SqlExceptionFactory
-
Field Summary
Fields Modifier and Type Field Description private Configuration
conf
private Connection
connection
private HostAddress
hostAddress
private static java.util.Set<java.lang.Integer>
LOCK_DEADLOCK_ERROR_CODES
private MariaDbPoolConnection
poolConnection
private java.sql.Statement
statement
private long
threadId
-
Constructor Summary
Constructors Modifier Constructor Description ExceptionFactory(Configuration conf, HostAddress hostAddress)
private
ExceptionFactory(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.String
buildMsgText(java.lang.String initialMessage, long threadId, Configuration conf, java.lang.String sql, int errorCode, Connection connection)
java.sql.SQLException
create(java.lang.String message)
java.sql.SQLException
create(java.lang.String message, java.lang.String sqlState)
java.sql.SQLException
create(java.lang.String message, java.lang.String sqlState, int errorCode)
java.sql.SQLException
create(java.lang.String message, java.lang.String sqlState, java.lang.Exception cause)
java.sql.BatchUpdateException
createBatchUpdate(java.util.List<Completion> res, int length, int[] responseMsg, java.sql.SQLException sqle)
java.sql.BatchUpdateException
createBatchUpdate(java.util.List<Completion> res, int length, java.sql.SQLException sqle)
private java.sql.SQLException
createException(java.lang.String initialMessage, java.lang.String sqlState, int errorCode, java.lang.Exception cause)
java.lang.String
getSql()
java.sql.SQLException
notSupported(java.lang.String message)
ExceptionFactory
of(java.sql.Statement statement)
ExceptionFactory
setConnection(Connection connection)
void
setConnection(ExceptionFactory oldExceptionFactory)
ExceptionFactory
setPoolConnection(MariaDbPoolConnection internalPoolConnection)
void
setThreadId(long threadId)
ExceptionFactory
withSql(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()
-
-