Tabnine Logo
DataSourceConfig.setHeartbeatSql
Code IndexAdd Tabnine to your IDE (free)

How to use
setHeartbeatSql
method
in
com.avaje.ebean.config.DataSourceConfig

Best Java code snippets using com.avaje.ebean.config.DataSourceConfig.setHeartbeatSql (Showing top 2 results out of 315)

origin: org.avaje.ebeanorm/avaje-ebeanorm-server

private DataSource getDataSourceFromConfig(ServerConfig config) {
 DataSource ds = null;
 if (config.getDataSourceJndiName() != null) {
  ds = jndiDataSourceFactory.lookup(config.getDataSourceJndiName());
  if (ds == null) {
   String m = "JNDI lookup for DataSource " + config.getDataSourceJndiName() + " returned null.";
   throw new PersistenceException(m);
  } else {
   return ds;
  }
 }
 DataSourceConfig dsConfig = config.getDataSourceConfig();
 if (dsConfig == null) {
  String m = "No DataSourceConfig definded for " + config.getName();
  throw new PersistenceException(m);
 }
 if (dsConfig.isOffline()) {
  if (config.getDatabasePlatformName() == null) {
   String m = "You MUST specify a DatabasePlatformName on ServerConfig when offline";
   throw new PersistenceException(m);
  }
  return null;
 }
 if (dsConfig.getHeartbeatSql() == null) {
  // use default heartbeatSql from the DatabasePlatform
  String heartbeatSql = getHeartbeatSql(dsConfig.getDriver());
  dsConfig.setHeartbeatSql(heartbeatSql);
 }
 return DataSourceGlobalManager.getDataSource(config.getName(), dsConfig);
}
origin: org.avaje/ebean

private DataSource getDataSourceFromConfig(ServerConfig config) {
 DataSource ds = null;
 if (config.getDataSourceJndiName() != null) {
  ds = jndiDataSourceFactory.lookup(config.getDataSourceJndiName());
  if (ds == null) {
   String m = "JNDI lookup for DataSource " + config.getDataSourceJndiName() + " returned null.";
   throw new PersistenceException(m);
  } else {
   return ds;
  }
 }
 DataSourceConfig dsConfig = config.getDataSourceConfig();
 if (dsConfig == null) {
  String m = "No DataSourceConfig definded for " + config.getName();
  throw new PersistenceException(m);
 }
 if (dsConfig.isOffline()) {
  if (config.getDatabasePlatformName() == null) {
   String m = "You MUST specify a DatabasePlatformName on ServerConfig when offline";
   throw new PersistenceException(m);
  }
  return null;
 }
 if (dsConfig.getHeartbeatSql() == null) {
  // use default heartbeatSql from the DatabasePlatform
  String heartbeatSql = getHeartbeatSql(dsConfig.getDriver());
  dsConfig.setHeartbeatSql(heartbeatSql);
 }
 return DataSourceGlobalManager.getDataSource(config.getName(), dsConfig);
}
com.avaje.ebean.configDataSourceConfigsetHeartbeatSql

Javadoc

Set a SQL statement used to test the database is accessible.

Note that if this is not set then it can get defaulted from the DatabasePlatform.

Popular methods of DataSourceConfig

  • <init>
  • getUrl
    Return the connection URL.
  • loadSettings
    Load the settings from ebean.properties.
  • setUrl
    Set the connection URL.
  • getDriver
    Return the database driver.
  • getCustomProperties
    Return a map of custom properties for the jdbc driver connection.
  • getHeartbeatSql
    Return a SQL statement used to test the database is accessible. Note that if this is not set then it
  • getIsolationLevel
    Return the transaction isolation level.
  • getLeakTimeMinutes
    Return the time in minutes after which a connection could be considered to have leaked.
  • getMaxConnections
    Return the maximum number of connections the pool can reach.
  • getMaxInactiveTimeSecs
    Return the time in seconds a connection can be idle after which it can be trimmed from the pool. Thi
  • getMaxStackTraceSize
    Return the max size for reporting stack traces on busy connections.
  • getMaxInactiveTimeSecs,
  • getMaxStackTraceSize,
  • getMinConnections,
  • getPassword,
  • getPoolListener,
  • getPstmtCacheSize,
  • getUsername,
  • getWaitTimeoutMillis,
  • isCaptureStackTrace,
  • isOffline

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • JLabel (javax.swing)
  • Top 17 PhpStorm Plugins
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