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

Connecting to the Datasource in ColdFusion 8 vs CF 6

New Here ,
Jul 25, 2008 Jul 25, 2008
Hi all,

I have a CF6 application that is running well. However, I'm in the process of upgrading to CF8, and some of the code no longer works. I've scoured the documentation and haven't found information on the replacement code.

My old code gets a datasource, acquires a database connection, uses the connection, and then closes the datasource.


variables.dsService = CreateObject("java", "coldfusion.server.ServiceFactory").DataSourceService;
variables.dsManager = dsService.getDman();
variables.dataSource = variables.dsManager.getDataSource(<data source name goes here>);
variables.dbConnection = variables.dataSource.getConnection();
<code to use the db connection goes here>
variables.dbConnection.close();

Under CF8, the error message is "The getDman method was not found." So I've been unable to find any code that will let me get access to an object that implements DataSource, so that I can use my connections.

Any advice would be appreciated.

Mike K.
TOPICS
Database access
547
Translate
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

correct answers 1 Correct answer

New Here , Jul 28, 2008 Jul 28, 2008
I ultimately discovered that what I needed was pretty simple

variables.dsService = CreateObject("java", "coldfusion.server.ServiceFactory").DataSourceService;
variables.dataSource = variables.dsService.getDataSource(<data source name>);
variables.dbConnection = variables.dataSource.getConnection();
<use the datasource>
variables.dbConnection.close();
Translate
LEGEND ,
Jul 27, 2008 Jul 27, 2008
not sure if these help:

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=basiconfig_37.html

http://localhost/CFIDE/adminapi/datasource.cfc

--
Ken Ford
Adobe Community Expert - Dreamweaver/ColdFusion
Fordwebs, LLC
http://www.fordwebs.com


"MKK2" <webforumsuser@macromedia.com> wrote in message news:g6d5sa$s0q$1@forums.macromedia.com...
> Hi all,
>
> I have a CF6 application that is running well. However, I'm in the process of
> upgrading to CF8, and some of the code no longer works. I've scoured the
> documentation and haven't found information on the replacement code.
>
> My old code gets a datasource, acquires a database connection, uses the
> connection, and then closes the datasource.
>
>
> variables.dsService = CreateObject("java",
> "coldfusion.server.ServiceFactory").DataSourceService;
> variables.dsManager = dsService.getDman();
> variables.dataSource = variables.dsManager.getDataSource(<data source
> name goes here>);
> variables.dbConnection = variables.dataSource.getConnection();
> <code to use the db connection goes here>
> variables.dbConnection.close();
>
> Under CF8, the error message is "The getDman method was not found." So I've
> been unable to find any code that will let me get access to an object that
> implements DataSource, so that I can use my connections.
>
> Any advice would be appreciated.
>
> Mike K.
>
Translate
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
New Here ,
Jul 28, 2008 Jul 28, 2008
LATEST
I ultimately discovered that what I needed was pretty simple

variables.dsService = CreateObject("java", "coldfusion.server.ServiceFactory").DataSourceService;
variables.dataSource = variables.dsService.getDataSource(<data source name>);
variables.dbConnection = variables.dataSource.getConnection();
<use the datasource>
variables.dbConnection.close();
Translate
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
Resources