/** * Ensures the DataSource properties are not changed after the DataSource has been used. * * @throws IllegalStateException The Database Name cannot be changed after the DataSource has been * used. */ public void setDatabaseName(String databaseName) { if (initialized) { throw new IllegalStateException( "Cannot set Data Source properties after DataSource has been used"); } super.setDatabaseName(databaseName); }
/** * Ensures the DataSource properties are not changed after the DataSource has * been used. * * @throws java.lang.IllegalStateException * The Database Name cannot be changed after the DataSource has been * used. */ public void setDatabaseName(String databaseName) { if (initialized) { throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used"); } super.setDatabaseName(databaseName); }
private void configureBaseDataSource(BaseDataSource ds, Properties props) throws SQLException { if (props.containsKey(JDBC_URL)) { ds.setUrl(props.getProperty(JDBC_URL)); } if (props.containsKey(JDBC_SERVER_NAME)) { ds.setServerName(props.getProperty(JDBC_SERVER_NAME)); } if (props.containsKey(JDBC_PORT_NUMBER)) { ds.setPortNumber(Integer.parseInt(props.getProperty(JDBC_PORT_NUMBER))); } if (props.containsKey(JDBC_DATABASE_NAME)) { ds.setDatabaseName(props.getProperty(JDBC_DATABASE_NAME)); } if (props.containsKey(JDBC_USER)) { ds.setUser(props.getProperty(JDBC_USER)); } if (props.containsKey(JDBC_PASSWORD)) { ds.setPassword(props.getProperty(JDBC_PASSWORD)); } for (Entry<Object, Object> entry : props.entrySet()) { ds.setProperty((String) entry.getKey(), (String) entry.getValue()); } }
protected Object loadBaseDataSource(BaseDataSource ds, Reference ref) { ds.setDatabaseName(getProperty(ref, "databaseName")); ds.setPassword(getProperty(ref, "password")); String port = getProperty(ref, "portNumber"); if (port != null) { ds.setPortNumber(Integer.parseInt(port)); } ds.setServerName(getProperty(ref, "serverName")); ds.setUser(getProperty(ref, "user")); String prepareThreshold = getProperty(ref, "prepareThreshold"); if (prepareThreshold != null) ds.setPrepareThreshold(Integer.parseInt(prepareThreshold)); return ds; }
/** * Ensures the DataSource properties are not changed after the DataSource has * been used. * * @throws java.lang.IllegalStateException * The Database Name cannot be changed after the DataSource has been * used. */ public void setDatabaseName(String databaseName) { if (initialized) { throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used"); } super.setDatabaseName(databaseName); }
/** * Ensures the DataSource properties are not changed after the DataSource has * been used. * * @throws java.lang.IllegalStateException * The Database Name cannot be changed after the DataSource has been * used. */ public void setDatabaseName(String databaseName) { if (initialized) { throw new IllegalStateException("Cannot set Data Source properties after DataSource has been used"); } super.setDatabaseName(databaseName); }
protected Object loadBaseDataSource(BaseDataSource ds, Reference ref) { ds.setDatabaseName(getProperty(ref, "databaseName")); ds.setPassword(getProperty(ref, "password")); String port = getProperty(ref, "portNumber"); if (port != null) { ds.setPortNumber(Integer.parseInt(port)); } ds.setServerName(getProperty(ref, "serverName")); ds.setUser(getProperty(ref, "user")); String prepareThreshold = getProperty(ref, "prepareThreshold"); if (prepareThreshold != null) ds.setPrepareThreshold(Integer.parseInt(prepareThreshold)); return ds; }
protected Object loadBaseDataSource(BaseDataSource ds, Reference ref) { ds.setDatabaseName(getProperty(ref, "databaseName")); ds.setPassword(getProperty(ref, "password")); String port = getProperty(ref, "portNumber"); if (port != null) { ds.setPortNumber(Integer.parseInt(port)); } ds.setServerName(getProperty(ref, "serverName")); ds.setUser(getProperty(ref, "user")); String prepareThreshold = getProperty(ref, "prepareThreshold"); if (prepareThreshold != null) ds.setPrepareThreshold(Integer.parseInt(prepareThreshold)); return ds; }