Interface ConnectionGenerator


public interface ConnectionGenerator
Used to manage java.sql.Connection objects required by DataJets. The DataJet class can create and manage its own Connection objects, or you can manage them yourself using a ConnectionGenerator. Creating a class that implements ConnectionGenerator allows you to do the following:
  • Share the same connection information between several DatJets
  • Use a Connection object obtained from a connection pool.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Frees resources after DataJet is finished using the Connection.
    Establishes the connection to be used by a DataJet.
  • Method Details

    • createConnection

      Connection createConnection() throws ConnectionException
      Establishes the connection to be used by a DataJet. A typical implementation contains:
              String url = [insert connection url];
              Connection con = DriverManager.getConnection(url);
              return con;
              
      Throws:
      ConnectionException - if there is a problem creating a connection to the database
    • closeConnection

      void closeConnection(Connection con)
      Frees resources after DataJet is finished using the Connection. A typical implementation contains:
          try {
              con.close();
          } catch ( Exception ex ) {
              //no action required - connection is already closed.
          }