Connection/Statement question

SimFox3_at_yahoo.com
Date: 08/20/04


Date: 20 Aug 2004 00:10:42 -0700

HI There,
Quick question on connection objects and statements. Assume that we
implement a singleton class which returns a reference to an already
existing connection object (created using DriverManager.. no pool).

I would assume that in a multi-client environment calling
createStatement on this one connection object would fail (since
connection encapsulates the server and client ip address).. is this
true?

Now lets assume that we are working in a multi-threaded environment
WITH ONLY one client who has a reference to a connection object that
they made. Calling createStatement concurrently should work right? And
what about concurrency issues... will executing executeUpdate() on two
statements @ the same time cause the connection object to execute both
of the statements concurrently or will it queue them up (assuming same
client w/ one connection object)?

Saad

THanks.



Relevant Pages

  • Re: Difference betten New & ...
    ... "Dim a As New ADODB.Connection" ... Both declares and defines a Connection Object which is referenced ... It always insures that 'a' will reference a connection object, ... If you manually set 'a' to Nothing, then you will automatically get a new ...
    (microsoft.public.vb.database.ado)
  • Re: Pass Connection Object between JSPs
    ... Except that the lifetime of the session is how long the user is active. ... So the Connection Object will not go away as long as the session has a reference to it. ...
    (comp.lang.java.programmer)