use of lucee.runtime.db.DataSource in project Lucee by lucee.
the class ConfigImpl method getDataSource.
@Override
public DataSource getDataSource(String datasource) throws DatabaseException {
DataSource ds = (datasource == null) ? null : (DataSource) datasources.get(datasource.toLowerCase());
if (ds != null)
return ds;
// create error detail
DatabaseException de = new DatabaseException("datasource [" + datasource + "] doesn't exist", null, null, null);
de.setDetail(ExceptionUtil.createSoundexDetail(datasource, datasources.keySet().iterator(), "datasource names"));
de.setAdditional(KeyConstants._Datasource, datasource);
throw de;
}
use of lucee.runtime.db.DataSource in project Lucee by lucee.
the class AppListenerUtil method toDataSources.
public static DataSource[] toDataSources(Config config, Object o, Log log) throws PageException {
Struct sct = Caster.toStruct(o);
Iterator<Entry<Key, Object>> it = sct.entryIterator();
Entry<Key, Object> e;
java.util.List<DataSource> dataSources = new ArrayList<DataSource>();
while (it.hasNext()) {
e = it.next();
dataSources.add(toDataSource(config, e.getKey().getString().trim(), Caster.toStruct(e.getValue()), log));
}
return dataSources.toArray(new DataSource[dataSources.size()]);
}
Aggregations