Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.jdeveloper.db.adapter
Interface ConnectionCreator

All Known Implementing Classes:
AbstractConnectionCreator, AbstractOracleConnCreator, CustomConnectionCreator, DB2ConnectionCreator, MySQLConnectionCreator, ODBCConnectionCreator, OracleConnectionCreator, OracleLiteConnectionCreator, SQLServerConnectionCreator

public interface ConnectionCreator

Creator for the DatabaseProvider to create a Connection given the key/value pairs accessible through the Properties class. A ConnectionCreator can be registered against the DatabaseProvider to provide support for more than the default set of jdbc connection types.


Method Summary
 java.sql.Connection getConnection(java.util.Properties props)
          Creates a Connection from the given Properties.
 java.lang.String getConnectionURL(java.util.Properties props)
          Returns the URL for the connection.
 java.lang.String getDriverClassName(java.util.Properties props)
          Returns the driver class for the connection.
 java.util.Collection<java.lang.String> listAllowedProperties()
          Gets a list of the properties that are relevant to this creator.
 boolean shouldEncrypt(java.lang.String propName)
          Indicates to the core getReference() logic whether a given property name should be encrypted when persisting or not.
 boolean shouldPromptForPassword(java.util.Properties props)
          Indicates wether the password prompter should be invoked (when available) for the given connection properties.
 

Method Detail

getConnection

java.sql.Connection getConnection(java.util.Properties props)
                                  throws java.sql.SQLException
Creates a Connection from the given Properties. The Properties contains key/value pairs for the information required to create the connection.

Parameters:
props - the Properties containing the connection data
Returns:
a JDBC Connection to a database
Throws:
java.sql.SQLException - if the connection cannot be created because the data is wrong or the database is down.

getConnectionURL

java.lang.String getConnectionURL(java.util.Properties props)
                                  throws java.sql.SQLException
Returns the URL for the connection.

Throws:
java.sql.SQLException

getDriverClassName

java.lang.String getDriverClassName(java.util.Properties props)
                                    throws java.sql.SQLException
Returns the driver class for the connection.

Throws:
java.sql.SQLException

shouldEncrypt

boolean shouldEncrypt(java.lang.String propName)
Indicates to the core getReference() logic whether a given property name should be encrypted when persisting or not.

Returns:
true if the given property should not be stored as plain text

shouldPromptForPassword

boolean shouldPromptForPassword(java.util.Properties props)
Indicates wether the password prompter should be invoked (when available) for the given connection properties.

Parameters:
props - the connection details that might need a password prompted for
Returns:
whether to show the prompter

listAllowedProperties

java.util.Collection<java.lang.String> listAllowedProperties()
Gets a list of the properties that are relevant to this creator. If a property is not listed, it is not needed/supported.

Returns:
a list of the allowed property keys for the connection's properties.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

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