ch.sahits.codegen.java.wizards
Class DTPConnection

java.lang.Object
  extended by ch.sahits.codegen.java.wizards.DTPConnection

public class DTPConnection
extends java.lang.Object

This class provides basic functionality to access data through DTP

Since:
1.1.0
Author:
Andi Hotz

Field Summary
protected  IConnectionProfile profile
          Connection profile
 
Constructor Summary
DTPConnection(java.lang.String connectionProfileName)
          Constructor initializing the connection profile
 
Method Summary
 IConnectionProfile getConnectionProfile()
          Retrieve the connection-profile
 IConnectionProfile getConnectionProfile(java.lang.String selectedName)
          Retrieve the connection profile by name.
 java.lang.String getConnectionURL()
          Retrieve the connection URL for the specified profile
 java.lang.String getDatabase(IConnectionProfile profile)
          Retrieve the database name of the profile.
protected  Database getDatabaseForProfile(IConnectionProfile profile)
          Retrieve the managed database for the given connection profile
 java.lang.String getDriverClass()
          Retrieve the connection driver class for the specified URL
 java.lang.String getHost(IConnectionProfile profile)
          Retrieve the host name of the profile
 java.util.List<java.lang.String> getOwner(IConnectionProfile profile)
          Retrieve all owner of the database
 java.lang.String getPortNumber(IConnectionProfile profile)
          Retrieve the port number from the profile
static IConnectionProfile getProfile(java.lang.String profileName)
          Connection profile for the given profile name
static java.util.List<java.lang.String> getRegisteredConnectionProfiles()
          Retrieve the names of the resisted connections
 java.util.List<Table> getTable(IConnectionProfile profile, java.lang.String schemaName)
          Retrieve all tables of a Schema
protected  Table getTable(java.lang.String schemaName, java.lang.String tableName)
          Retrieve the table of the connection profile for a given schema and table name
 java.lang.String getVenorNameUpperCase(IConnectionProfile profile)
          Retrieve the vendor of the database-product
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profile

protected IConnectionProfile profile
Connection profile

Constructor Detail

DTPConnection

public DTPConnection(java.lang.String connectionProfileName)
Constructor initializing the connection profile

Parameters:
connectionProfileName -
Method Detail

getConnectionProfile

public final IConnectionProfile getConnectionProfile()
Retrieve the connection-profile

Returns:
IConnectionProfile

getConnectionProfile

public final IConnectionProfile getConnectionProfile(java.lang.String selectedName)
Retrieve the connection profile by name. If there are two connection profiles with the same name the first found is choosen.

Parameters:
selectedName -
Returns:
IConnectionProfile

getDatabaseForProfile

protected final Database getDatabaseForProfile(IConnectionProfile profile)
Retrieve the managed database for the given connection profile

Parameters:
profile - connection profile
Returns:
Database instance

getTable

protected final Table getTable(java.lang.String schemaName,
                               java.lang.String tableName)
Retrieve the table of the connection profile for a given schema and table name

Parameters:
schemaName -
tableName -
Returns:
Table Object

getTable

public final java.util.List<Table> getTable(IConnectionProfile profile,
                                            java.lang.String schemaName)
Retrieve all tables of a Schema

Parameters:
profile - Connection profile
schemaName - name of the schema
Returns:
List of tables

getOwner

public final java.util.List<java.lang.String> getOwner(IConnectionProfile profile)
Retrieve all owner of the database

Parameters:
profile - Connection profile of the database
Returns:
List of the owners

getRegisteredConnectionProfiles

public static java.util.List<java.lang.String> getRegisteredConnectionProfiles()
Retrieve the names of the resisted connections

Returns:
List of connection names

getProfile

public static IConnectionProfile getProfile(java.lang.String profileName)
Connection profile for the given profile name

Parameters:
profileName -
Returns:
connection profile or null if none could be found

getVenorNameUpperCase

public final java.lang.String getVenorNameUpperCase(IConnectionProfile profile)
Retrieve the vendor of the database-product

Parameters:
profile - of the database
Returns:
vendor name in upper-case

getPortNumber

public final java.lang.String getPortNumber(IConnectionProfile profile)
Retrieve the port number from the profile

Parameters:
profile - of the database
Returns:
port number

getHost

public final java.lang.String getHost(IConnectionProfile profile)
Retrieve the host name of the profile

Parameters:
profile - of the database
Returns:
host name

getDatabase

public final java.lang.String getDatabase(IConnectionProfile profile)
Retrieve the database name of the profile. The database name is hold in the property 'org.eclipse.datatools.connectivity.db.databaseName'

Parameters:
profile - of the database
Returns:
database name

getConnectionURL

public final java.lang.String getConnectionURL()
Retrieve the connection URL for the specified profile

Returns:
connection URL

getDriverClass

public final java.lang.String getDriverClass()
Retrieve the connection driver class for the specified URL

Returns:
connection driver class