Or you can do it the other way around: if this is a Java app that's a servlet or JSP, which is running in the same J2EE container as your CF app, and your CF app is running on CF Enterprise (7 or 8), you can change CF to use a JNDI datasource instead of a native CF datasource. JNDI datasources are defined in the Admin console of the J2EE server (JRun, Tomcat, WebLogic, etc.). Many don't realize that CF offers this option. You'll see it as one of the options for adding a new datasource in CF, but again only in CF Enterprise (or Developer). Think of it like the ODBC-type DSN, where the definition was in Windows, and CF just "pointed" to it. This is similar in concept to what a JNDI dsn is, but it's defined in the J2EE server rather than in the OS.
Hope that helps. I realize you may not be running a Java program that's a JSP or servlet running on the same J2EE server as CF. If that's not the case, I suppose Andy's way will be the only one (but I just don't know). /charlie From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Powell Sent: Wednesday, April 02, 2008 9:43 AM To: discussion@acfug.org Subject: Re: [ACFUG Discuss] can external java app use datasources defined in Coldfusion? You have to dig into the Admin API, but it can be done. You have to pass the datasource into the java object from CF. ap On Apr 2, 2008, at 9:41 AM, [EMAIL PROTECTED] wrote: Hello, We have some java application using its own datasource to connect to the database. This requires either hardcoding username and password or put it in a config file. Is there a way for this jav app to use datasources defined in Coldfusion so that java app can share the same db connection pool? Jay Jayaraman Central Billing Services Financial Management and Planning (404) 498-8453 (W) (404) 273-7131 (C) ------------------------------------------------------------- Annual Sponsor - Figleaf Software <http://www.figleaf.com> To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by FusionLink <http://www.fusionlink.com> ------------------------------------------------------------- ------------------------------------------------------------- Annual Sponsor FigLeaf Software - http://www.figleaf.com To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------