RE: Using an existing JDBC Connection



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 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.
| | | 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.
.



Relevant Pages

  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... When the first test is run, the results are stored in the central database. ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... to the central server, but you are willing to live with periods where it ... i.e. a local database or even a text file. ... to function until the connection can be restored to the server. ...
    (microsoft.public.data.ado)
  • Re: ADO Connection Timeout
    ... much rather write stored procedures and use server side cursors. ... local database, it is vital that I get the information to a central server. ... Once the connection is restored, ...
    (microsoft.public.data.ado)
  • Re: ESQL/C documentation nightmare
    ... documentation about explicit and implicit connections. ... CONNECTION connection statements for new applications of Version 6.0 ... the SQL database statements (such as ...
    (comp.databases.informix)