Re: How can I get multiple connections when I use Oracles server side JDBC driver ?

From: Prof. Ambrosius <prof_ambrosius_at_yahoo.de>
Date: 19 Oct 2001 01:40:12 -0700
Message-ID: <9463374e.0110190040.424b0501_at_posting.google.com>


faheemrao_at_yahoo.com (FaheemRao) wrote in message news:<43b58913.0109281508.41624773_at_posting.google.com>...
> Ok you can get Multiple Connection to same database , that is no
> problem in any Language.
>
> I dont know much about jave , but I know that it is very easy in C++.
>
> So don't curse me if I say some which is not applicable in Java.:)
>
> You just have to create a new instance of the Database Class.
> I am sure you can create a new instance of a Class in java and then
> call the
> the getConnection("jdbc:oracle:kprb:");
>
> Ok in jave where the Connection handle to database is stored , you
> jut have to make a new instance of that Object and that it is.



Here is the problem. In that case I would have two connection objects, but they would use the same logical connection. If one is blocked for some reason, the other is too. Primarily I created just two threads and two connection objects that use the oracle default connection each. Then I read in the oracle doc that every time a connection object that uses the default connection is created, oracle assigns the same connection. Can that really be true ??

>
> may be these few lines can help you !
>
> Faheem Rao
>
>
>
> prof_ambrosius_at_yahoo.de (Prof. Ambrosius) wrote in message news:<9463374e.0109260611.1949f43a_at_posting.google.com>...
> > As everyone knows, one can get a connection to Oracle 8i internal JDBC
> > driver by writing the Java Code
> >
> > // dont use defaultConnection(), deprecated
> > Connection dbConnection =
> > DriverManager.getConnection("jdbc:oracle:kprb:");
> >
> > But how can I get a NEW connection to the same source ? Multiple calls
> > just return a new connection object that uses the same internal
> > connection.
> >
> > (I want to use the really new connection for a call to a stored
> > procedure that may block for a long time, while the main application
> > should use the other connection for other work. )
> >
> > Prof.A.
Received on Fri Oct 19 2001 - 10:40:12 CEST

Original text of this message