Share Connection between classes in client app

From: DM (mackdaddy315_at_hotmail.com)
Date: 06/30/04


Date: 30 Jun 2004 06:18:13 -0700

Hello folks,
I am writing a client based application in Java. The program will
Connect to an Oracle server via JDBC and run various tasks (mostly
selects for reporting purposes). Right now I have each task broken up
into a separate class file so each one creates and handles its own
connection. In web apps I use connection pools but this is not an
option with this project. Is there a way to share a single connection
within a application so that you don't have to pass it to every class
( ie myclass(Connection con) ).

Thanks



Relevant Pages

  • Re: looking for opinons regarding best practices (jdbc, resultsets, and servlet design)
    ... (switching from JDBC to JNDI or a Web service, ... of data entity value objects around without keeping a connection open. ... back non-Cached RowSets or ResultSets requires an active connection. ... In real life one would likely want to log this exception. ...
    (comp.lang.java.programmer)
  • Re: Unblocking items in firewall - Symantec AntiVirus Corporate Edition
    ... > I sell a server based software product. ... > Symantec AntiVirus Corporate Edition product but one of my customers ... It will not block connection attempts. ... Is my JDBC connection code incorrect? ...
    (comp.security.firewalls)
  • SPWDCSM and JDBC clients
    ... Jerry K. mentioned the Data studio download a week or so ago. ... IBM Data Studio v1.1, IDS 11.1FC1, Informix JDBC driver (one with data ... I did try a .rhost entry for the client host on the server host. ... Removing the csm entry allows the connection to work. ...
    (comp.databases.informix)
  • RE: Connection.TRANSACTION_SERIALIZABLE
    ... I'm not seeing a JDBC section on here. ... Using non Microsoft JDBC connectiong ... > | Connection.TRANSACTION_SERIALIZABLE to our SQL Server. ... > | connection setting interact with the code it touches? ...
    (microsoft.public.sqlserver.odbc)
  • Re: JDBC Connection Help
    ... database in VBS. ... I have the correct driver 0jdbc.jar which from what I can tell contains ... trying to establish a JDBC connection. ...
    (microsoft.public.scripting.vbscript)