Exemplo n.º 1
0
 /**
  * Gets a handle to a connection object in the given application. This version opens the
  * connection by name If param is null or "" get the first connection available
  *
  * @param lAppID the appid of the application to get the connection for
  * @param sConnectionName the name of the connection
  * @return the JDBC connection object
  * @throws an Exception if there was a problem getting the connection
  */
 public Connection getDataConnection(long lAppID, String sConnectionName) throws Exception {
   TornadoServerInstance tsi = TornadoServer.getInstance();
   TornadoApplication ta = tsi.getTornadoApplication(lAppID);
   Connection cx = ta.getDataConnection(sConnectionName);
   m_htConnections.put(cx, cx);
   return cx;
 }
Exemplo n.º 2
0
 /** Used in webdesign.pma */
 public void releaseDataConnection(long lAppID, Connection cx) {
   TornadoServerInstance tsi = TornadoServer.getInstance();
   TornadoApplication ta = tsi.getTornadoApplication(lAppID);
   if (ta.releaseDataConnection(cx)) {
     m_htConnections.remove(cx);
     m_iDataConnReleaseCount++;
     return;
   }
 }
Exemplo n.º 3
0
  /** Finds an entry in the String table for i18n */
  public String getStringTableEntry(String sStringTableKey, String sVariables[]) {
    Locale loc = getLocale();

    TornadoServerInstance tsi = TornadoServer.getInstance(m_SysCtx);
    TornadoApplication ta = tsi.getTornadoApplication(this.getRequestPath().getPathToApplication());
    String sMessage = ta.getStringTableEntry(sStringTableKey, loc);

    return pmaLog.parseMessage(sMessage, sVariables);
  }
Exemplo n.º 4
0
  /**
   * Unlocks a database connection.
   *
   * @param cx the connection object to put back into the database pool
   */
  public void releaseDataConnection(Connection cx) {
    TornadoServerInstance tsi = TornadoServer.getInstance();
    TornadoApplication ta = tsi.getTornadoApplication(m_rPath.getPathToApplication());
    if (ta.releaseDataConnection(cx)) {
      m_htConnections.remove(cx);
      m_iDataConnReleaseCount++;
      return;
    }

    // Release by appid
    Hashtable htApp = tsi.getAllLoadedApplications();
    Iterator it = htApp.values().iterator();
    while (it.hasNext()) {
      ta = (TornadoApplication) it.next();
      if (ta.releaseDataConnection(cx)) return;
    }

    return;
  }
Exemplo n.º 5
0
 /**
  * Get a list of all the connection names in the current application
  *
  * @return a Vector of Strings
  */
 public Vector getAllDataConnectionNames() {
   TornadoServerInstance tsi = TornadoServer.getInstance();
   TornadoApplication ta = tsi.getTornadoApplication(m_rPath.getPathToApplication());
   return ta.getAllDataConnectionNames();
 }
Exemplo n.º 6
0
 public String getDataConnectionProperty(String sConnectionName, String sPropertyName) {
   TornadoServerInstance tsi = TornadoServer.getInstance();
   TornadoApplication ta = tsi.getTornadoApplication(m_rPath.getPathToApplication());
   return ta.getDataConnectionProperty(sConnectionName, sPropertyName);
 }
Exemplo n.º 7
0
 /**
  * Gets a handle to a connection object. This version opens the connection by name If param is
  * null or "" get the first connection available
  *
  * @param sConnectionName the name of the connection as it appears in the application's design
  * @return a JDBC connection object, null if one could not be opened
  */
 public Connection getDataConnection(String sConnectionName) throws Exception {
   m_iDataConnGetCount++;
   TornadoServerInstance tsi = TornadoServer.getInstance();
   TornadoApplication ta = tsi.getTornadoApplication(m_rPath.getPathToApplication());
   return ta.getDataConnection(sConnectionName);
 }