protected static Struct _loadData(PageContext pc, String datasourceName,String strType,int type, Log log, boolean mxStyle) throws PageException {
ConfigImpl config = (ConfigImpl)pc.getConfig();
DatasourceConnectionPool pool = config.getDatasourceConnectionPool();
DatasourceConnection dc=pool.getDatasourceConnection(pc,((PageContextImpl)pc).getDataSource(datasourceName),null,null);
SQLExecutor executor=SQLExecutionFactory.getInstance(dc);
Query query;
try {
if(!dc.getDatasource().isStorage())
throw new ApplicationException("storage usage for this datasource is disabled, you can enable this in the railo administrator.");
query = executor.select(pc.getConfig(),pc.getCFID(),pc.getApplicationContext().getName(), dc, type,log, true);
}
catch (SQLException se) {
throw Caster.toPageException(se);
}
finally {
if(dc!=null) pool.releaseDatasourceConnection(dc);
}
if(query!=null && pc.getConfig().debug()) {
boolean debugUsage=DebuggerUtil.debugQueryUsage(pc,query);
((DebuggerPro)pc.getDebugger()).addQuery(debugUsage?query:null,datasourceName,"",query.getSql(),query.getRecordcount(),pc.getCurrentPageSource(),query.getExecutionTime());