July 25, 2015
Configuring JNDI Data sources in ColdFusion
Comments
(2)
July 25, 2015
Configuring JNDI Data sources in ColdFusion
(2)

(Originally written in Jul 2015, updated in Jan 2021)

For a more complete and updated discussion of this topic, see the 2019 post, Guide to configure JNDI datasource in ColdFusion.

This 2015 post below expanded on a still-older one, linked to below. Both are combined and updated into the more recent post.

For configuring JNDI data sources, it should firstly be supported by the application server.

Tomcat server, which is built-into ColdFusion server, has the support for this by default.

While there is a blog here on this how to configure, I want to explain few mistakes that are tend to be done while configuring.

One common mistake generally done is when the data source is configured from the ColdFusion administrator by
providing irrelevant    username/password. You may tend to provide Database’s username/password. This is NOT
Database’s username/password. It is the application server’s username and password on which data
source is configured. It should be left blank when the credentials are not required by the
server.

Prepending java:comp/env/ is required for the actual JNDI name that is registered in xml while registering the name in administrator.

It is not mandatory that you register the JNDI data source in ColdFusion administrator.

As long as the app server supports JNDI, you can invoke the data source that is configured in the application server in cfm source code directly either in case of standalone installation or EAR/WAR deployment. But for consistency and preferred names that can used in ColdFusion should be registered in ColdFusion.

This is applicable to both ColdFusion 10 and ColdFusion 11.

2 Comments
2019-07-30 13:03:27
2019-07-30 13:03:27

*Corrected the broken link with the working article.

Like
(1)
>
Priyank Shrivastava
's comment
2019-11-21 18:45:13
2019-11-21 18:45:13
>
Priyank Shrivastava
's comment

For interested readers, the “working” post is here: https://coldfusion.adobe.com/2019/07/guide-configure-jndi-datasource-coldfusion/. Thanks for offering the corrected version, Priyank.

Like
(1)
Add Comment