RE: Using an existing JDBC Connection
- From: Mathew.Delong@xxxxxxxxxxxxxxx (Mathew Delong)
- Date: Thu, 9 Aug 2007 16:12:48 -0400
The issue is that I want to keep the connections on the database to a
minimum (1 if possible,) to avoid any problems which might come up with
a maximum number of connections be allowed at any given time.
I was thinking there might be some java library out there which will
basically wrap a JDBC connection and at the same time act as the
connection retrieved from DBI for the Perl script. So the script thinks
it is dealing with one connection when it is actually delegating into
the original one.
-----Original Message-----
From: Peter J. Holzer [mailto:hjp@xxxxxxxxx]
Sent: Thursday, August 09, 2007 12:38 PM
To: dbi-users@xxxxxxxx
Subject: Re: Using an existing JDBC Connection
On 2007-08-09 11:57:53 -0400, Mathew Delong wrote:
I am calling into a Perl script from a Java class to retrievewould
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
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.
| | | hjp@xxxxxxxxx | I don't, and I'm not.
__/ | http://www.hjp.at/ | -- Jesse Erlbaum on dbi-users
CONFIDENTIALITY NOTICE: This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply email and destroy all copies of the original message.
.
- Follow-Ups:
- Re: Using an existing JDBC Connection
- From: Peter J. Holzer
- Re: Using an existing JDBC Connection
- From: Jonathan Leffler
- Re: Using an existing JDBC Connection
- References:
- Using an existing JDBC Connection
- From: Mathew Delong
- Re: Using an existing JDBC Connection
- From: Peter J. Holzer
- Using an existing JDBC Connection
- Prev by Date: RE: Load Testing Script
- Next by Date: Re: Using an existing JDBC Connection
- Previous by thread: Re: Using an existing JDBC Connection
- Next by thread: Re: Using an existing JDBC Connection
- Index(es):
Relevant Pages
|