Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.2)

E13403-10


oracle.jdeveloper.db
Class AppDatabaseConnections

java.lang.Object
  extended by oracle.jdeveloper.db.AppDatabaseConnections


public class AppDatabaseConnections
extends java.lang.Object

Extension to the DatabaseConnections API that gets the database connections defined for an Application (Workspace).

Since:
11

Method Summary
static boolean canCopyToApplicationResources(java.lang.String connName, Context ideContext)
          Checks to see whether a copyToApplicationResources operation will succeed or not.
static void copyConnectionBetweenStores(java.lang.String sourceStore, java.lang.String targetStore, java.lang.String connName)
          Copies the given connection between two different connection stores.
static void copyToApplicationResources(java.lang.String connName, Context ideContext)
          Utility method to copy the given named connection from the Resource Palette's connections to the Application Resources for the Application (Workspace) in the given IDE context.
static void copyToApplicationResources(java.lang.String connName, java.lang.String newName, Context ideContext)
          Utility method to copy the given named connection from the Resource Palette's connections to the Application Resources for the Application (Workspace) in the given IDE context.
static boolean ensureInApplicationResources(java.lang.String connName, Context ideContext)
          Ensures that the connection is in Application Resources.
static boolean ensureInApplicationResources(java.lang.String connName, java.lang.String newName, Context ideContext)
          Ensures that the connection is in Application Resources.
static DatabaseConnections getAppDatabaseConnections()
          Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace) found in the current IDE Context, which is retrieved using Context.newIdeContext().
static DatabaseConnections getAppDatabaseConnections(Context ideContext)
          Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace) found in the given IDE Context.
static DatabaseConnections getAppDatabaseConnections(Workspace ws)
          Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace).
static java.lang.String getConnectionStoreName(Context context)
          Gets the connection store name for the Application in the given Context.
static java.lang.String getConnectionStoreName(java.net.URL appURL)
          Gets the connection store name for the given Application's URL.
static java.lang.String getConnectionStoreName(Workspace w)
          Gets the connection store name for the given Application (Workspace).
static DatabaseConnections getCurrentDatabaseConnections(Context ideContext)
          Deprecated. use DatabaseConnectionStores.getCurrentStore(oracle.ide.Context)
static Workspace getWorkspace(Context context)
          Gets the current workspace/application for the given Context.
static Workspace getWorkspace(java.lang.String storeName)
          Returns the Workspace for the given store name, if the store name is that of an Application resources store.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getWorkspace

public static Workspace getWorkspace(Context context)
Gets the current workspace/application for the given Context. If the Context view is the Database Navigator the internal workspace that uses is ignored and the current app open in the appnav is returned instead.

getAppDatabaseConnections

public static DatabaseConnections getAppDatabaseConnections()
Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace) found in the current IDE Context, which is retrieved using Context.newIdeContext().
Returns:
a DatabaseConnections wrapper around the current application's connections, or null if the current IDE context contains no Application (Workspace).
See Also:
getAppDatabaseConnections(oracle.ide.Context)

getAppDatabaseConnections

public static DatabaseConnections getAppDatabaseConnections(Context ideContext)
Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace) found in the given IDE Context.
Parameters:
ideContext - contains the Application (Workspace) that's home to the connections
Returns:
a DatabaseConnections wrapper around the application's connections, or null if there is no Application (Workspace) in the given context.

getAppDatabaseConnections

public static DatabaseConnections getAppDatabaseConnections(Workspace ws)
Creates a DatabaseConnections wrapper for the Application Connections in the Application (Workspace).
Parameters:
ws - the Application (Workspace) that's home to the connections
Returns:
a DatabaseConnections wrapper around the application's connections, or null if there is no Application (Workspace) in the given context.

getCurrentDatabaseConnections

@Deprecated
public static DatabaseConnections getCurrentDatabaseConnections(Context ideContext)
Deprecated. use DatabaseConnectionStores.getCurrentStore(oracle.ide.Context)
If the current context is the Resource Palette or Database Navigator this returns the central DatabaseConnections instance. Otherwise this returns the DatabaseConnections for the "Application Resources" in the current Application (Workspace).
Parameters:
ideContext - the current IDE context
Returns:
the DatabaseConnections appropriate to the current context.
See Also:
getAppDatabaseConnections(oracle.ide.Context), DatabaseConnections.getInstance()

copyToApplicationResources

public static void copyToApplicationResources(java.lang.String connName,
                                              Context ideContext)
                                       throws ConnectionException
Utility method to copy the given named connection from the Resource Palette's connections to the Application Resources for the Application (Workspace) in the given IDE context. If the connection already exists in the Application Resources and is identical to the Resource Palette definition, or there is no Resource Palette definition this method will do nothing.
Parameters:
connName - the name of the connection to copy
ideContext - the context containing the application to copy the connection to.
Throws:
ConnectionException - if the connection exists in both places, but has different properties, of if the connection cannot be found.
See Also:
ensureInApplicationResources(String,Context)

copyToApplicationResources

public static void copyToApplicationResources(java.lang.String connName,
                                              java.lang.String newName,
                                              Context ideContext)
                                       throws ConnectionException
Utility method to copy the given named connection from the Resource Palette's connections to the Application Resources for the Application (Workspace) in the given IDE context. The connection will be given a new name in the application resource as defined. If the connection already exists in the Application Resources and is identical to the Resource Palette definition, or there is no Resource Palette definition this method will do nothing.
Parameters:
connName - the name of the connection to copy
newName - the name the connection is to have in the application resources (if null the connection isn't renamed).
ideContext - the context containing the application to copy the connection to.
Throws:
ConnectionException - if the connection exists in both places, but has different properties, of if the connection cannot be found.
See Also:
ensureInApplicationResources(String,String,Context)

canCopyToApplicationResources

public static boolean canCopyToApplicationResources(java.lang.String connName,
                                                    Context ideContext)
Checks to see whether a copyToApplicationResources operation will succeed or not. Succeed means one of two things:
  1. the connection can be copied from the Resource Palette to the Application Resources for the Application (Workspace) in the given IDE context.
  2. An identical connection already exists in the Application Resources for the Application.
    Parameters:
    connName - the connection to be tested
    ideContext - the context containing the Application
    Returns:
    true if a call to copyToApplicationResources will succeed.
    See Also:
    copyToApplicationResources(String,Context)

    copyConnectionBetweenStores

    public static void copyConnectionBetweenStores(java.lang.String sourceStore,
                                                   java.lang.String targetStore,
                                                   java.lang.String connName)
                                            throws ConnectionException
    
    Copies the given connection between two different connection stores.
    Parameters:
    sourceStore - the name of the source connection store
    targetStore - the name of the target connection store
    connName - the connection to copy from source store to target store
    Throws:
    ConnectionException

    ensureInApplicationResources

    public static boolean ensureInApplicationResources(java.lang.String connName,
                                                       Context ideContext)
    
    Ensures that the connection is in Application Resources. If the connection is in Application Resources or is successfully copied from the Resource Palette true is returned, else the user is notified of the problem and false is returned.
    Parameters:
    connName - the connection name
    ideContext - the current Ide Conext
    Returns:
    true if the connection can be used from the Application Resource
    See Also:
    copyToApplicationResources(String,Context)

    ensureInApplicationResources

    public static boolean ensureInApplicationResources(java.lang.String connName,
                                                       java.lang.String newName,
                                                       Context ideContext)
    
    Ensures that the connection is in Application Resources. If the connection is in Application Resources or is successfully copied from the Resource Palette true is returned, else the user is notified of the problem and false is returned. If provided, the new name given will be used for the connection in the application resources.
    Parameters:
    connName - the connection name
    newName - the connection's new name for the application resources.
    ideContext - the current Ide Conext
    Returns:
    true if the connection can be used from the Application Resource
    See Also:
    #copyToApplicationResources(String.String,Context)

    getConnectionStoreName

    public static java.lang.String getConnectionStoreName(Context context)
    
    Gets the connection store name for the Application in the given Context. The store name is used to get the DatabaseConnections from the DatabaseConnectionStores

    getConnectionStoreName

    public static java.lang.String getConnectionStoreName(Workspace w)
    
    Gets the connection store name for the given Application (Workspace). The store name is used to get the DatabaseConnections from the DatabaseConnectionStores
    Returns:
    the connection store name for the given workspace, or null if the Workspace is null or invalid.

    getConnectionStoreName

    public static java.lang.String getConnectionStoreName(java.net.URL appURL)
    
    Gets the connection store name for the given Application's URL. The store name is used to get the DatabaseConnections from the DatabaseConnectionStores
    Returns:
    the connection store name for the given workspace, or null if the given workspace URL is invalid.

    getWorkspace

    public static Workspace getWorkspace(java.lang.String storeName)
    
    Returns the Workspace for the given store name, if the store name is that of an Application resources store. If it is not the store name for a valid Application resources store null is returned.

    Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
    11g Release 1 (11.1.1.7.2)

    E13403-10

    Copyright © 1997, 2013, Oracle. All rights reserved.