Skip to content

Instantly share code, notes, and snippets.

@elpete
Created January 11, 2018 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpete/ae7b5926a2f8ee97b9c6058626cd5182 to your computer and use it in GitHub Desktop.
Save elpete/ae7b5926a2f8ee97b9c6058626cd5182 to your computer and use it in GitHub Desktop.
Lucee datasources created in Application.cfc not available in the psuedo-constructor
component {
// this datasource needs to be accessible
this.datasources["coolblog"] = {
class = "org.gjt.mm.mysql.Driver",
connectionString = "jdbc:mysql://localhost:3306/coolblog?useUnicode=true&characterEncoding=UTF-8&useLegacyDatetimeCode=true",
username = "root",
password = "coolblog"
};
// uncomment this line to make it pass
// cfapplication( datasources = this.datasources );
// this call will fail with no datasource being found
cfdbinfo( type="Version", datasource="coolblog", name="info" );
writeDump( var = info, top = 2, abort = true );
}
<!--- Intentionally left blank --->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment