congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
JDBCConnectionException
Code IndexAdd Tabnine to your IDE (free)

How to use
JDBCConnectionException
in
org.hibernate.exception

Best Java code snippets using org.hibernate.exception.JDBCConnectionException (Showing top 14 results out of 315)

origin: hibernate/hibernate-orm

  || SQLNonTransientConnectionException.class.isInstance( sqlException )
  || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
return new JDBCConnectionException( message, sqlException, sql );
origin: hibernate/hibernate-orm

return new JDBCConnectionException( message, sqlException, sql );
origin: gwenn/sqlite-dialect

  @Override
  public JDBCException convert(SQLException sqlException, String message, String sql) {
    final int errorCode = JdbcExceptionHelper.extractErrorCode( sqlException ) & 0xFF;
    if (errorCode == SQLITE_TOOBIG || errorCode == SQLITE_MISMATCH) {
      return new DataException( message, sqlException, sql );
    }
    else if (errorCode == SQLITE_BUSY || errorCode == SQLITE_LOCKED) {
      return new LockAcquisitionException( message, sqlException, sql );
    }
    else if ((errorCode >= SQLITE_IOERR && errorCode <= SQLITE_PROTOCOL) || errorCode == SQLITE_NOTADB) {
      return new JDBCConnectionException( message, sqlException, sql );
    }
    // returning null allows other delegates to operate
    return null;
  }
};
origin: org.hibernate/com.springsource.org.hibernate

  || SQLNonTransientConnectionException.class.isInstance( sqlException )
  || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
return new JDBCConnectionException( message, sqlException, sql );
origin: org.hibernate.orm/hibernate-core

  || SQLNonTransientConnectionException.class.isInstance( sqlException )
  || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
return new JDBCConnectionException( message, sqlException, sql );
origin: hibernate/hibernate

/**
 * Convert the given SQLException into Hibernate's JDBCException hierarchy.
 *
 * @param sqlException The SQLException to be converted.
 * @param message      An optional error message.
 * @param sql          Optionally, the sql being performed when the exception occurred.
 * @return The resulting JDBCException.
 */
public JDBCException convert(SQLException sqlException, String message, String sql) {
  String sqlStateClassCode = JDBCExceptionHelper.extractSqlStateClassCode( sqlException );
  if ( sqlStateClassCode != null ) {
    if ( SQL_GRAMMAR_CATEGORIES.contains( sqlStateClassCode ) ) {
      return new SQLGrammarException( message, sqlException, sql );
    }
    else if ( INTEGRITY_VIOLATION_CATEGORIES.contains( sqlStateClassCode ) ) {
      String constraintName = extracter.extractConstraintName( sqlException );
      return new ConstraintViolationException( message, sqlException, sql, constraintName );
    }
    else if ( CONNECTION_CATEGORIES.contains( sqlStateClassCode ) ) {
      return new JDBCConnectionException( message, sqlException, sql );
    }
  }
  return handledNonSpecificException( sqlException, message, sql );
}
origin: org.hibernate/com.springsource.org.hibernate.core

  || SQLNonTransientConnectionException.class.isInstance( sqlException )
  || SQLTransientConnectionException.class.isInstance( sqlException ) ) {
return new JDBCConnectionException( message, sqlException, sql );
origin: sensepost/yeti

  @Override
  public JDBCException convert(SQLException sqlException, String message, String sql) {
    final int errorCode = sqlException.getErrorCode();
    if (errorCode == SQLITE_CONSTRAINT) {
      final String constraintName = EXTRACTER.extractConstraintName(sqlException);
      return new ConstraintViolationException(message, sqlException, sql, constraintName);
    } else if (errorCode == SQLITE_TOOBIG || errorCode == SQLITE_MISMATCH) {
      return new DataException(message, sqlException, sql);
    } else if (errorCode == SQLITE_BUSY || errorCode == SQLITE_LOCKED) {
      return new LockAcquisitionException(message, sqlException, sql);
    } else if ((errorCode >= SQLITE_IOERR && errorCode <= SQLITE_PROTOCOL) || errorCode == SQLITE_NOTADB) {
      return new JDBCConnectionException(message, sqlException, sql);
    }
    return new GenericJDBCException(message, sqlException, sql);
  }
};
origin: org.hibernate/com.springsource.org.hibernate

return new JDBCConnectionException( message, sqlException, sql );
origin: org.hibernate/com.springsource.org.hibernate.core

return new JDBCConnectionException( message, sqlException, sql );
origin: jboss.jboss-embeddable-ejb3/hibernate-all

return new JDBCConnectionException( message, sqlException, sql );
origin: org.hibernate.orm/hibernate-core

return new JDBCConnectionException( message, sqlException, sql );
origin: hibernate/hibernate

/**
 * Convert the given SQLException into Hibernate's JDBCException hierarchy.
 *
 * @param sqlException The SQLException to be converted.
 * @param message      An optional error message.
 * @param sql          Optionally, the sql being performed when the exception occurred.
 * @return The resulting JDBCException.
 */
public JDBCException convert(SQLException sqlException, String message, String sql) {
  int errorCode = JDBCExceptionHelper.extractErrorCode( sqlException );
  if ( isMatch( getConnectionErrorCodes(), errorCode ) ) {
    return new JDBCConnectionException( message, sqlException, sql );
  }
  else if ( isMatch( getSQLGrammarErrorCodes(), errorCode ) ) {
    return new SQLGrammarException( message, sqlException, sql );
  }
  else if ( isMatch( getIntegrityViolationErrorCodes(), errorCode ) ) {
    String constraintName = extracter.extractConstraintName( sqlException );
    return new ConstraintViolationException( message, sqlException, sql, constraintName );
  }
  else if ( isMatch( getLockAcquisitionErrorCodes(), errorCode ) ) {
    return new LockAcquisitionException( message, sqlException, sql );
  }
  return handledNonSpecificException( sqlException, message, sql );
}
origin: com.atlassian.hibernate/hibernate.adapter

  return adaptInstantiationException((net.sf.hibernate.InstantiationException) ex);
if (ex instanceof net.sf.hibernate.exception.JDBCConnectionException)
  return new org.hibernate.exception.JDBCConnectionException(ex.getMessage(), getSQLExceptionFromThrowable(ex.getCause()));
if (ex instanceof net.sf.hibernate.exception.LockAcquisitionException)
  return new org.hibernate.exception.LockAcquisitionException(ex.getMessage(), getSQLExceptionFromThrowable(ex.getCause()));
org.hibernate.exceptionJDBCConnectionException

Javadoc

Implementation of JDBCException indicating problems with communicating with the database (can also include incorrect JDBC setup).

Most used methods

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JTextField (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now