[JDBC] Keeping Connection object for a long time



Hi !

I've got an app where users can query a remote database (Derby or MySQL) through a JDBC Driver whith this kind of code : Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
Connection connection = DriverManager.getConnection(dsURL);
Statement .....


My problem is that I would like to hold the Connection object all along the application session (which may last a few hours) whithout disturbing other users of the database not connecting with my program. In other words, does the fact to keep the same Connection object for multiple queries allong 2 or 3 hours present any deadlock issues or be source of conflicts with external users accessing the database tables ?

All the examples I have read for now close the connection right after the processing.

TIA for advises,

--
Arnaud
.



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: Communicating over the internet
    ... > That way you provide one manner in which to open the database, ... > can keep the connection open and then when someone wants to ... > server as the database and the soap dll connecting with a TCP socket. ... The name of the running program might help. ...
    (microsoft.public.vb.general.discussion)
  • 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)