On 2007-08-09 11:57:53 -0400, Mathew Delong wrote:
> I am calling into a Perl script from a Java class to retrieve
> information from a database, and am interested in using DBI for the
> connection. However, the Java class calling into the perl script will
> already have an established JDBC connection to the database, and I would
> like to reuse this connection instead of creating a second connection.

Generally this is not possible. Your perl script will be executed by a
second process and most databases don't support sharing database
connections between processes (It's too difficult to keep the processess
from messing with each other). Even if your database does support it, it
is unlikely that the JDBC driver and the DBD driver also support it in
a compatible way, so I wouldn't bother and just open a new connection.

        hp

-- 
   _  | Peter J. Holzer    | If I wanted to be "academically correct",
|_|_) | Sysadmin WSR       | I'd be programming in Java.
| |   | [EMAIL PROTECTED]      | I don't, and I'm not.
__/   | http://www.hjp.at/ |   -- Jesse Erlbaum on dbi-users

Attachment: pgpM4vazBt943.pgp
Description: PGP signature

Reply via email to