当前位置: 首页>>代码示例>>Java>>正文


Java MySQLNonTransientConnectionException类代码示例

本文整理汇总了Java中com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException的典型用法代码示例。如果您正苦于以下问题:Java MySQLNonTransientConnectionException类的具体用法?Java MySQLNonTransientConnectionException怎么用?Java MySQLNonTransientConnectionException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MySQLNonTransientConnectionException类属于com.mysql.jdbc.exceptions.jdbc4包,在下文中一共展示了MySQLNonTransientConnectionException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resetDatabaseTable

import com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException; //导入依赖的package包/类
public static void resetDatabaseTable(String tableName) throws Exception
{
  try
  {
    doResetDatabaseTable(tableName);
  }
  catch (MySQLNonTransientConnectionException e) // Database probably doesn't exist, create it.
  {
    createDatabase();
  }
  doResetDatabaseTable(tableName);
}
 
开发者ID:Malow,项目名称:GladiatorManager,代码行数:13,代码来源:TestHelpers.java

示例2: isExceptionIndicativeOfOverload

import com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException; //导入依赖的package包/类
/**
 * Indicates whether an exception is a symptom of MySQL being overloaded or slow.
 * Typical symptoms are connection pool exhaustion or MySQL connection/socket timeouts.
 */
public static boolean isExceptionIndicativeOfOverload(Exception e) {
  return e instanceof MySQLNonTransientConnectionException
      || e instanceof CommunicationsException
      || (e instanceof SQLNestedException
              && e.getCause() instanceof NoSuchElementException);
}
 
开发者ID:pinterest-attic,项目名称:pinlater,代码行数:11,代码来源:MySQLBackendUtils.java

示例3: handleSQLConstraintException

import com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException; //导入依赖的package包/类
@ExceptionHandler(value = {SQLIntegrityConstraintViolationException.class, MySQLNonTransientConnectionException.class, DataIntegrityViolationException.class})
public ModelAndView handleSQLConstraintException(Exception ex) {
    final ModelAndView mav = new ModelAndView("exception");
    mav.addObject("message", MessageFactory.error("jpm.constraint.exception"));
    JPMUtils.getLogger().fatal("Constraint Exception", ex);
    return mav;
}
 
开发者ID:jpaoletti,项目名称:java-presentation-manager-2,代码行数:8,代码来源:ExceptionController.java


注:本文中的com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。