net.java.ao.db
Enum SupportedDBProvider

java.lang.Object
  extended by java.lang.Enum<SupportedDBProvider>
      extended by net.java.ao.db.SupportedDBProvider
All Implemented Interfaces:
Serializable, Comparable<SupportedDBProvider>

public enum SupportedDBProvider
extends Enum<SupportedDBProvider>

Contains a list of all internally supported database providers and their associated JDBC prefixes (e.g. "jdbc:mysql"). This list is used in the auto-magical database driver selection based on JDBC URI.

This list does not include third-party database providers. Thus, if you implement a database provider for Sybase, you must pass it directly to EntityManager; you cannot rely upon the auto-magical URI parsing as it will not apply to the new provider.

This enum is designed primarily for INTERNAL use within AO. While it is perfectly acceptible to utilize this enum externally, the API may change unnexpectedly, undocumented results may occur, you know the drill.

Author:
Daniel Spiewak
See Also:
DatabaseProvider

Enum Constant Summary
EMBEDDED_DERBY
           
EMBEDDED_HSQLDB
           
JTDS_MS_SQL_SERVER
           
MS_SQL_SERVER
           
MYSQL
           
NETWORK_DERBY
           
NETWORK_HSQLDB
           
ORACLE_OCI
           
ORACLE_THIN
           
POSTGRESQL
           
 
Method Summary
 DatabaseProvider createInstance(String uri, String username, String password)
           
 String getPrefix()
           
static SupportedDBProvider getProviderForURI(String uri)
          Returns the SupportedDBProvider which corresponds to the database provider which corresponds to the specified JDBC URI.
 Class<? extends DatabaseProvider> getType()
           
static SupportedDBProvider valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SupportedDBProvider[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MYSQL

public static final SupportedDBProvider MYSQL

NETWORK_DERBY

public static final SupportedDBProvider NETWORK_DERBY

EMBEDDED_DERBY

public static final SupportedDBProvider EMBEDDED_DERBY

ORACLE_THIN

public static final SupportedDBProvider ORACLE_THIN

ORACLE_OCI

public static final SupportedDBProvider ORACLE_OCI

POSTGRESQL

public static final SupportedDBProvider POSTGRESQL

MS_SQL_SERVER

public static final SupportedDBProvider MS_SQL_SERVER

JTDS_MS_SQL_SERVER

public static final SupportedDBProvider JTDS_MS_SQL_SERVER

NETWORK_HSQLDB

public static final SupportedDBProvider NETWORK_HSQLDB

EMBEDDED_HSQLDB

public static final SupportedDBProvider EMBEDDED_HSQLDB
Method Detail

values

public static SupportedDBProvider[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SupportedDBProvider c : SupportedDBProvider.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SupportedDBProvider valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getPrefix

public String getPrefix()

getType

public Class<? extends DatabaseProvider> getType()

createInstance

public DatabaseProvider createInstance(String uri,
                                       String username,
                                       String password)

getProviderForURI

public static SupportedDBProvider getProviderForURI(String uri)
Returns the SupportedDBProvider which corresponds to the database provider which corresponds to the specified JDBC URI. If no corresponding proivder is found, null is returned.

Parameters:
uri - The JDBC URI for which a database provider is required.
Returns:
The enum value which corresponds to the required database provider.