Class SQLExceptionConvertorBase
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.SQLExceptionConvertorBase
-
- All Implemented Interfaces:
SQLExceptionConvertor
public abstract class SQLExceptionConvertorBase extends Object implements SQLExceptionConvertor
Converts aSQLException
to aDBException
. A stateless service object.
-
-
Constructor Summary
Constructors Constructor Description SQLExceptionConvertorBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DBException
convertSQLException(String operation, SQLException sqle)
ConvertsSQLException
toDBException
.DBException
convertSQLException(String operation, SQLException sqle, String query)
ConvertsSQLException
toDBException
.static SQLExceptionConvertorBase
getConvertor(DatabaseType dbType)
Provides with the instance of exception convertor that is appropriate for the specified DBMS.
-
-
-
Method Detail
-
getConvertor
@NotNull public static SQLExceptionConvertorBase getConvertor(DatabaseType dbType)
Provides with the instance of exception convertor that is appropriate for the specified DBMS.- Parameters:
dbType
- DBMS.- Returns:
- appropriate convertor.
-
convertSQLException
@NotNull public final DBException convertSQLException(@NotNull String operation, @NotNull SQLException sqle)
ConvertsSQLException
toDBException
.- Specified by:
convertSQLException
in interfaceSQLExceptionConvertor
- Parameters:
operation
- operation that occured this exception (a human readable text).sqle
- the SQL exception to convert.- Returns:
- converted DB exception.
-
convertSQLException
@NotNull public final DBException convertSQLException(@NotNull String operation, @NotNull SQLException sqle, @Nullable String query)
ConvertsSQLException
toDBException
.- Specified by:
convertSQLException
in interfaceSQLExceptionConvertor
- Parameters:
operation
- operation that occured this exception (a human readable text).sqle
- the SQL exception to convert.query
- SQL query that couses this exception.- Returns:
- converted DB exception.
-
-