Class JdbcException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConfigException, DaoMethodNotFoundException, DomainTypeNotFoundException, DuplicateColumnException, EmptyWhereClauseException, EntityPropertyAccessException, EntityPropertyNotDefinedException, EntityPropertyNotFoundException, EntityTypeNotFoundException, JdbcUnsupportedOperationException, NonSingleColumnException, NonUniqueResultException, NoResultException, OptimisticLockException, OriginalStatesAccessException, OriginalStatesNotFoundException, ResultMappingException, SavepointAlreadyExistsException, SavepointNotFoundException, ScriptException, ScriptFileNotFoundException, SqlExecutionException, SqlFileNotFoundException, TransactionAlreadyBegunException, TransactionNotYetBegunException, UniqueConstraintException, UnknownColumnException

public class JdbcException extends DomaException
Thrown to indicate a JDBC related error during database operations.

This is the base exception class for all JDBC-related exceptions in Doma. It provides common functionality for handling SQL-related errors and formatting SQL statements for error messages.

Specific subclasses provide more detailed information about particular types of JDBC errors, such as SQL syntax errors, constraint violations, or mapping problems.

See Also:
  • Constructor Details

    • JdbcException

      public JdbcException(MessageResource messageCode, Object... args)
      Constructs a new JdbcException with the specified message code and arguments.
      Parameters:
      messageCode - the message code that identifies the error message
      args - the arguments to format the error message
    • JdbcException

      public JdbcException(MessageResource messageCode, Throwable cause, Object... args)
      Constructs a new JdbcException with the specified message code, cause, and arguments.
      Parameters:
      messageCode - the message code that identifies the error message
      cause - the cause of this exception
      args - the arguments to format the error message
  • Method Details

    • choiceSql

      protected static String choiceSql(SqlLogType logType, String rawSql, String formattedSql)
      Chooses the SQL string for logging depending on the log type
      Parameters:
      logType - the log type
      rawSql - the raw SQL string
      formattedSql - the formatted SQL string
      Returns:
      the SQL string