oracle.soda
Interface OracleDatabaseAdmin


public interface OracleDatabaseAdmin

Provides DDL and metadata methods for the OracleDatabase administration: collection creation, retrieval of collection names, etc.

An OracleCollectionAdmin object is associated with a particular OracleCollection object.


Method Summary
 OracleCollection createCollection(java.lang.String collectionName)
          Creates a collection with the specified name.
 OracleCollection createCollection(java.lang.String collectionName, OracleDocument collectionMetadata)
          Creates a collection with the specified name and implementation-specific collection metadata, expressed in JSON.
 java.util.List<java.lang.String> getCollectionNames()
          Gets a list of the names of all collections in the database.
 java.util.List<java.lang.String> getCollectionNames(int limit)
          Gets a list of the names of collections in the database with a limit on the number returned.
 java.util.List<java.lang.String> getCollectionNames(int limit, int skip)
          Gets a list of the names of collections in the database with a limit on the number returned, starting at a specific offset in the list.
 java.util.List<java.lang.String> getCollectionNames(int limit, java.lang.String startName)
          Gets a list of the names of collections in the database with a limit on the number returned, starting at the first name greater than or equal to startName.
 java.sql.Connection getConnection()
          Return the JDBC connection backing this database.
 

Method Detail

createCollection

OracleCollection createCollection(java.lang.String collectionName)
                                  throws OracleException
Creates a collection with the specified name. For some implementations this will use default options for the creation.

If the collection with the specified collectionName exists, it's returned.

Parameters:
collectionName - collection name
Returns:
OracleCollection created collection
Throws:
OracleException - if the collection could not be created

createCollection

OracleCollection createCollection(java.lang.String collectionName,
                                  OracleDocument collectionMetadata)
                                  throws OracleException
Creates a collection with the specified name and implementation-specific collection metadata, expressed in JSON.

Passing null for collectionMetadata is equivalent to invoking createCollection(String).

If the collection with the specified collectionName exists, it's returned (unless it's metadata doesn't match the metadata specified via collectionMetadata, in which case an exception is thrown).

Parameters:
collectionName - collection name
collectionMetadata - implementation-specific collection metadata
Returns:
OracleCollection created collection
Throws:
OracleException - if (1) the collection could not be created, or (2) the collection with the provided collectionName already exists and its metadata does not match the metadata specified in collectionMetadata

getCollectionNames

java.util.List<java.lang.String> getCollectionNames()
                                                    throws OracleException
Gets a list of the names of all collections in the database.

Returns:
a list of collection names
Throws:
OracleException - if there is an error retrieving collection names from the database

getCollectionNames

java.util.List<java.lang.String> getCollectionNames(int limit)
                                                    throws OracleException
Gets a list of the names of collections in the database with a limit on the number returned. This method implies that the list is ordered.

Parameters:
limit - a limit on the number of names returned. Must be positive
Returns:
a list of collection names
Throws:
OracleException - if (1) the limit is negative, or (2) there is an error retrieving collection names from the database

getCollectionNames

java.util.List<java.lang.String> getCollectionNames(int limit,
                                                    int skip)
                                                    throws OracleException
Gets a list of the names of collections in the database with a limit on the number returned, starting at a specific offset in the list. This method implies that the list is ordered.

Parameters:
limit - a limit on the number of names returned. Must be positive
skip - a number of names to skip. Must not be negative
Returns:
a list of collection names
Throws:
OracleException - if (1) the limit or skip are negative, or (2) there is an error retrieving collection names from the database

getCollectionNames

java.util.List<java.lang.String> getCollectionNames(int limit,
                                                    java.lang.String startName)
                                                    throws OracleException
Gets a list of the names of collections in the database with a limit on the number returned, starting at the first name greater than or equal to startName. This method implies that the list is ordered.

Parameters:
limit - a limit on the number of names returned. Must be positive
startName - the starting name. All names greater than or equal to this name will be returned. Cannot be null
Returns:
a list of collection names. If there is no collection name greater than startName, null is returned
Throws:
OracleException - if (1) the limit is negative, or (2) the startName is null or empty, or (3) there is an error retrieving collection names from the database

getConnection

java.sql.Connection getConnection()
Return the JDBC connection backing this database.

Returns:
the JDBC connection backing this database. null if this database is not backed by a single JDBC connection