• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

JNDI data source

Explorer ,
Mar 05, 2014 Mar 05, 2014

Copy link to clipboard

Copied

I'm trying to use a JNDI data source in CF 10. We used to do it in CF 8 in the JRun admin, and was able to use data sources across coldFusion and java code. Any ideas on how to make it work in CF 10? I've tried several online resources, setting up a resource in Context.xml:

  <Resource name="mydatasource" auth="Container" type="javax.sql.DataSource"

               maxActive="100" maxIdle="30" maxWait="10000"

               username="myuser" password="mypass" driverClassName="macromedia.jdbc.MacromediaDriver"

               url="jdbc:macromedia:sqlserver://127.0.0.1:1433;databaseName=mydb;SendStringParametersAsUnicode=false;SendStringAsUnicode=false"/>

then a resource-ref in web.xml

<resource-ref>

      <description>DB Connection</description>

      <res-ref-name>mydatasource</res-ref-name>

      <res-type>javax.sql.DataSource</res-type>

      <res-auth>Container</res-auth>

            </resource-ref>

but I'm getting errors

java.lang.IllegalArgumentException: Cannot convert value of type [jav

a.lang.String] to required type [javax.sql.DataSource] for property 'dataSource'

: no matching editors or conversion strategy found

Views

371

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation