Assistance with Using ColdBox Framework for New Project Setup !!

Hi everyone,

I am currently starting a new project and I have decided to use the ColdBox framework. However…, I am running into some issues during the initial setup. I have followed the documentation…, but I am unsure about a few key steps that might be causing problems in my environment.

Specifically…, I am having trouble configuring the datasource in the ColdBox configuration file. I have tried different settings…, but it seems like the application isn’t connecting properly to the database.

Could anyone with experience using ColdBox give me some guidance on how to correctly configure this: ?? Any tips on common pitfalls to avoid during the initial setup would be greatly appreciated.

Also…, if there’s any helpful resource or blog post from the community that you could recommend, that would be great !! I have also gone through the forum and found this thread https://community.ortussolutions.com/t/new-to-coldbox-having-issues-getting-setup-react-native but couldn’t get anything.

Thanks in advance for your help !!

With Regards,
Marcelo Salas

Can you give us an example of what you are setting in the config/Coldbox.cfc file?

While the coldbox.cfc file may have references to the datasource name, it does not set the datasource for the application. This is done in Application.cfc. There are a few ways it can be handled. The most common are:

One, you create the datasource in the ACF/LUCEE admin and set datasource name in the application.cfc

this.datasource = "AppDataSource";

Or two, define the datasource in the Application.cfc file as well and then set the default datasource

    this.datasources = {
        AppDataSource    = {
            database    = "myAppDbName",
            host        = "localhost",
            port        = "1433",
            driver      = "MSSQLServer",
            username    = "username",
            password    = "password"
        }
    };
    this.datasource    = "AppDataSource";

A quick tip that may seem obvious but remember to verify that you can connect to the database using something other than ColdFusion. Much easier to troubleshoot access and authentication issues.

One of the great things about Ortus is the large quantity of training, documentation and references that are available. Here are a few that I would suggest other than the obvious, this site.

  1. CFCasts.com. Quite a lot of free videos. Here is a series specifically on ColdBox. While it may be 4 years old, most all of it will still be very relevant.
  2. OrtusBooks.com. Here is the actual ColdBox documentation if you haven’t already been reading over it.
  3. The ColdBox API Docs are also very helpful. Take a look

I hope this helps. Feel free to follow up with any questions and/or let us know how it goes.