How do I pass a CF2021 application name to the database in connection string? I tried cfconfig.json, but it does not work. I tried setting clientApplicationName, clientApplicationNamePrefix, custom, connectionString and dsn.
If I set it in data & services > data source > show advanced settings > Connection String
ApplicationName=Something Something Darkside
Then, running this query will correctly show the name set above. SELECT distinct program_name
WHERE program_name <> ‘’
relevant part from cfconfig.json, also I was trying to see if anyone of them will show up:
I’m not sure where you got the connectionString key from, but there no such setting name for a datasource in CFConfig! I believe what you’re looking for is custom, which is (Extra JDBC URL query string without leading &).
The JDBC URL is only used if the DB type is “Other”. This is to prevent invalid URLs from getting imported if a user is transferring Lucee config to Adobe, etc. So long as you put your custom bits in the custom field, then they should get appended to the JDBC URL. You can confirm in the neo-datasources.xml file.
I made up the connectionString, since I was desperately trying to get the Application Name sent over. I looked at other cfconfig.json params, where datasource settings are camel cased with no space. Max Pooled Statements becomes maxPooledStatements, Maintain Connections becomes maintainConnections and so on.
Adding the following,“custom”: “ApplicationName=DoesThisWork”, actually does not work. This query or sp_who2 will not show “DoesThisWork”
SELECT distinct program_name
WHERE program_name <> ‘’
Where is your neo-datasource.xml on commandbox with docker? I cannot find it.
command you can see what the options are. Also, setting up the datasource the way you want it in the web admin and then simply exporting those settings to JSON is the easiest way to get the correct JSON.
In the server home with the rest of the XML files. I have no idea how you’ve set up your docker image, but if you SSH into your docker image and run
box server info property=serverHomeDirectory
in the web root of the server, it should take you to where the CF engine lives. Or, just experiment on a local server outside of Docker where it’s 100 times easier to debug this sort of stuff.
I don’t know if you’re expecting anyone here to somehow read your mind (or the contents of your hard drive), but there’s no telling why I would start by making sure haven’t removed it from your .cfconfig.json file that gets imported when the server starts. I’d also confirm what json files CFConfig is loading to ensure you’re editing the right one.