Some of the changes in CFMX 6.1 had the unfortunate side-effect of no longer enabling access to CF datasources through JNDI. The official solution to this is to use CFMX 4 J2EE and set up datasources through the underlying J2EE server.
Turns out this drastic change is not absolutely necessary. fozizzle posted a code snippet in the web forums that retrieves a CFMX 6.1 datasource from Java.
public static Connection getUsingCFService(String datasource) {
DataSourceService ds =
coldfusion.server.ServiceFactory.getDataSourceService();
try {
return ds.getDatasource(datasource).getConnection();
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
Nice find!
Picked up from Macromedia webforums.