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

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

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

origin: org.avaje/ebean

if (serverConfig.getDataSourceConfig().isOffline()) {
origin: org.avaje.ebeanorm/avaje-ebeanorm-server

if (serverConfig.getDataSourceConfig().isOffline()) {
origin: org.avaje/ebean

/**
 * Create the appropriate database specific platform.
 */
public DatabasePlatform create(ServerConfig serverConfig) {
 try {
  if (serverConfig.getDatabasePlatformName() != null) {
   // choose based on dbName
   return byDatabaseName(serverConfig.getDatabasePlatformName());
  }
  if (serverConfig.getDataSourceConfig().isOffline()) {
   String m = "You must specify a DatabasePlatformName when you are offline";
   throw new PersistenceException(m);
  }
  // guess using meta data from driver
  return byDataSource(serverConfig.getDataSource());
 } catch (Exception ex) {
  throw new PersistenceException(ex);
 }
}
origin: org.avaje.ebeanorm/avaje-ebeanorm-server

/**
 * Create the appropriate database specific platform.
 */
public DatabasePlatform create(ServerConfig serverConfig) {
 try {
  if (serverConfig.getDatabasePlatformName() != null) {
   // choose based on dbName
   return byDatabaseName(serverConfig.getDatabasePlatformName());
  }
  if (serverConfig.getDataSourceConfig().isOffline()) {
   String m = "You must specify a DatabasePlatformName when you are offline";
   throw new PersistenceException(m);
  }
  // guess using meta data from driver
  return byDataSource(serverConfig.getDataSource());
 } catch (Exception ex) {
  throw new PersistenceException(ex);
 }
}
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);
}
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);
}
com.avaje.ebean.configDataSourceConfigisOffline

Javadoc

Return true if the DataSource should be left offline.

This is to support DDL generation etc without having a real database.

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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