Codota Logo
leap.core.ds
Code IndexAdd Codota to your IDE (free)

How to use leap.core.ds

Best Java code snippets using leap.core.ds (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: org.leapframework/leap-core

@Override
public DataSource tryCreateDataSource(DataSourceProps conf) {
  ensureGetDriverClass(conf);
  
  UnPooledDataSource ds = new UnPooledDataSource();
  
  ds.setDriverClassName(conf.getDriverClassName());
  ds.setJdbcUrl(conf.getJdbcUrl());
  ds.setUsername(conf.getUsername());
  ds.setPassword(conf.getPassword());
  ds.setDefaultAutoCommit(conf.getDefaultAutoCommit());
  ds.setDriverProperties(conf.getExtProperties());
  return ds;
}
origin: org.leapframework/leap-core

protected void notifyDataSourceDestroyed(String name,DataSource ds) {
  unexportDataSourceMBean(name, ds);
  for(DataSourceListener l : listeners){
    l.onDataSourceDestroyed(name, ds);
  }
}
origin: org.leapframework/leap-core

protected void notifyDataSourceCreated(String name, DataSource ds, boolean exportMBean) {
  if(ds instanceof MDataSourceProxy) {
    ((MDataSourceProxy) ds).setName(name);
  }
  if(exportMBean) {
    exportDataSourceMBean(name, ds);
  }
  for(DataSourceListener l : listeners){
    l.onDataSourceCreated(name, ds);
  }
}

origin: org.leapframework/jmms-engine

protected DataSource newDataSource(MetaDataSource meta) throws SQLException {
  DataSourceProps props = new DataSourceProps.Builder(toMap(meta)).build();
  log.debug("DataSource url '{}', username: {}", props.getJdbcUrl(), props.getUsername());
  return dataSourceManager.createDataSource(props);
}
origin: org.leapframework/leap-core

public Builder(String driverClassName,String url,String username,String password) {
  this.setDriverClassName(driverClassName)
    .setUrl(url)
    .setUsername(username)
    .setPassword(password);
}

origin: org.leapframework/leap-core

@Override
public DataSource createDefaultDataSource(DataSourceProps conf) throws ObjectExistsException,SQLException {
  synchronized (this) {
    if(null != defaultDataSource){
      throw new ObjectExistsException("Default dataSource already exists");
    }
    DataSource ds = createDataSource(conf);
    
    this.defaultDataSource = ds;
    this.allDataSources.put(DEFAULT_DATASOURCE_NAME, ds);
    
    notifyDataSourceCreated(DEFAULT_DATASOURCE_NAME, ds, conf.isExportMBean());
    
    return ds;
  }
}
origin: org.leapframework/leap-core

public static Builder createBuilder() {
  return new Builder();
}

origin: org.leapframework/leap-core

public Builder setUrl(String url){
  return setProperty(JDBC_URL, url);
}

origin: org.leapframework/leap-core

public Connection getConnection(String username, String password) throws SQLException {
  return doGetConnection(username, password);
}
origin: org.leapframework/leap-core

@Override
public boolean tryValidateDataSource(DataSource ds) {
  try {
    validateDataSource(ds);
    return true;
  } catch (SQLException e) {
    return false;
  }
}
origin: org.leapframework/leap-core

  public DataSourceProps build() {
    return new DataSourceProps(dataSourceType,_default, properties);
  }
}
origin: org.leapframework/leap-core

protected void unexportDataSourceMBean(String name, DataSource ds) {
  if(!(ds instanceof MDataSource)) {
    return;
  }
  mbeanExporter.unexport(objectName(name));
}
origin: org.leapframework/leap-core

  @Override
  public Logger getParentLogger() throws SQLFeatureNotSupportedException {
    return determineTargetDataSource().getParentLogger();
  }
}
origin: org.leapframework/leap-core

@Override
public DataSource getDataSource(String name) throws ObjectNotFoundException {
  DataSource ds = tryGetDataSource(name);
  
  if(null == ds){
    throw new ObjectNotFoundException("DataSource '" + name + "' not found");
  }
  
  return ds;
}
origin: org.leapframework/leap-core

public Builder setDriverClassName(String driverClassName){
  return setProperty(DRIVER_CLASS_NAME, driverClassName);
}

origin: org.leapframework/leap-core

public Connection getConnection() throws SQLException {
  return doGetConnection(username, password);
}
origin: org.leapframework/leap-core

public Builder setJdbcUrl(String url) {
  return setProperty(JDBC_URL, url);
}

origin: org.leapframework/leap-core

public Builder setUsername(String username){
  return setProperty(USERNAME, username);
}

origin: org.leapframework/leap-core

public Builder setPassword(String password) {
  return setProperty(PASSWORD, password);
}

origin: org.leapframework/leap-core

public Builder setExportMBean(boolean exportMBean) {
  setProperty(EXPORT_MBEAN, String.valueOf(exportMBean));
  return this;
}
leap.core.ds

Most used classes

  • DataSourceManager
  • DataSourceProps
  • DataSourceProps$Builder
  • AbstractDataSourceFactory
  • DataSourceFactory
  • DefaultDataSourceManager,
  • ReadWriteSplittingDataSource,
  • UnPooledDataSource,
  • UnPooledDataSourceFactory,
  • TomcatDataSourceFactory,
  • MConnection,
  • MConnectionProxy,
  • MDataSource,
  • MDataSourceConfig,
  • MDataSourceProxy$ActiveConnectionsModel,
  • MDataSourceProxy$ConnectionModel,
  • MDataSourceProxy$SlowSql,
  • MDataSourceProxy
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now