com.sas.rio
Class LDAPDatabaseMetaData

java.lang.Object
  |
  +--com.sas.rio.MVADatabaseMetaData
        |
        +--com.sas.rio.LDAPDatabaseMetaData

public class LDAPDatabaseMetaData
extends MVADatabaseMetaData

This class extends the MVADatabaseMetaData class. The metadata information related to the database (like schema/table/column) is accessed from an LDAP directory structure. Rest of the DatabaseMetaData information is simply inherited from the original MVADatabaseMetaData class. Not all information is available from LDAP. If you compare the LDAPDatabaseMetaData implementation with the MVADatabaseMetaData object, the only difference is access of dictionary tables. LDAP replaces dictionary funtions. So, instead of querying the dictionary tables LDAPDatabaseMetaData looks in LDAP.

Many of the methods here return lists of information in ResultSets. You can use the normal ResultSet methods such as getString and getInt to retrieve the data from these ResultSets. If a given form of metadata is not available, these methods should throw a SQLException.

Some of these methods take arguments that are String patterns. These arguments all have names such as fooPattern. Within a pattern String, "%" means match any substring of 0 or more characters, and "_" means match any one character. Only metadata entries matching the search pattern are returned. If a search pattern argument is set to a null ref, it means that argument's criteria should be dropped from the search.

A SQLException will be thrown if a driver does not support a meta data method. In the case of methods that return a ResultSet, either a ResultSet (which may be empty) is returned or a SQLException is thrown.


Field Summary
static java.lang.String INITCTX
           
 
Fields inherited from class com.sas.rio.MVADatabaseMetaData
bookmarkLength, bookmarkLengthHolder, sasDataSet, status
 
Constructor Summary
LDAPDatabaseMetaData(MVAConnection connection, java.util.Properties info)
          Constructs LDAPDatabaseMetaData object.
 
Method Summary
 java.sql.ResultSet getColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern)
          Gets a description of table columns available in LDAP.
 java.sql.ResultSet getSchemas()
          Gets the schema names available in LDAP.
 java.sql.ResultSet getTables(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types)
          Gets a description of the tables that are defined in LDAP.
 java.sql.ResultSet getTableTypes()
          Gets the table types available in LDAP.
 
Methods inherited from class com.sas.rio.MVADatabaseMetaData
allProceduresAreCallable, allTablesAreSelectable, dataDefinitionCausesTransactionCommit, dataDefinitionIgnoredInTransactions, deletesAreDetected, doesMaxRowSizeIncludeBlobs, getBestRowIdentifier, getCatalogs, getCatalogSeparator, getCatalogTerm, getColumnPrivileges, getConnection, getCrossReference, getDatabaseProductName, getDatabaseProductVersion, getDefaultTransactionIsolation, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getExportedKeys, getExtraNameCharacters, getIdentifierQuoteString, getImportedKeys, getIndexInfo, getMaxBinaryLiteralLength, getMaxCatalogNameLength, getMaxCharLiteralLength, getMaxColumnNameLength, getMaxColumnsInGroupBy, getMaxColumnsInIndex, getMaxColumnsInOrderBy, getMaxColumnsInSelect, getMaxColumnsInTable, getMaxConnections, getMaxCursorNameLength, getMaxIndexLength, getMaxProcedureNameLength, getMaxRowSize, getMaxSchemaNameLength, getMaxStatementLength, getMaxStatements, getMaxTableNameLength, getMaxTablesInSelect, getMaxUserNameLength, getNumericFunctions, getPrimaryKeys, getProcedureColumns, getProcedures, getProcedureTerm, getSchemaTerm, getSearchStringEscape, getSQLKeywords, getStringFunctions, getSystemFunctions, getTablePrivileges, getTimeDateFunctions, getTypeInfo, getUDTs, getURL, getUserName, getVersionColumns, insertsAreDetected, isCatalogAtStart, isReadOnly, nullPlusNonNullIsNull, nullsAreSortedAtEnd, nullsAreSortedAtStart, nullsAreSortedHigh, nullsAreSortedLow, othersDeletesAreVisible, othersInsertsAreVisible, othersUpdatesAreVisible, ownDeletesAreVisible, ownInsertsAreVisible, ownUpdatesAreVisible, storesLowerCaseIdentifiers, storesLowerCaseQuotedIdentifiers, storesMixedCaseIdentifiers, storesMixedCaseQuotedIdentifiers, storesUpperCaseIdentifiers, storesUpperCaseQuotedIdentifiers, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsANSI92EntryLevelSQL, supportsANSI92FullSQL, supportsANSI92IntermediateSQL, supportsBatchUpdates, supportsCatalogsInDataManipulation, supportsCatalogsInIndexDefinitions, supportsCatalogsInPrivilegeDefinitions, supportsCatalogsInProcedureCalls, supportsCatalogsInTableDefinitions, supportsColumnAliasing, supportsConvert, supportsConvert, supportsCoreSQLGrammar, supportsCorrelatedSubqueries, supportsDataDefinitionAndDataManipulationTransactions, supportsDataManipulationTransactionsOnly, supportsDifferentTableCorrelationNames, supportsExpressionsInOrderBy, supportsExtendedSQLGrammar, supportsFullOuterJoins, supportsGroupBy, supportsGroupByBeyondSelect, supportsGroupByUnrelated, supportsIntegrityEnhancementFacility, supportsLikeEscapeClause, supportsLimitedOuterJoins, supportsMinimumSQLGrammar, supportsMixedCaseIdentifiers, supportsMixedCaseQuotedIdentifiers, supportsMultipleResultSets, supportsMultipleTransactions, supportsNonNullableColumns, supportsOpenCursorsAcrossCommit, supportsOpenCursorsAcrossRollback, supportsOpenStatementsAcrossCommit, supportsOpenStatementsAcrossRollback, supportsOrderByUnrelated, supportsOuterJoins, supportsPositionedDelete, supportsPositionedUpdate, supportsResultSetConcurrency, supportsResultSetType, supportsSchemasInDataManipulation, supportsSchemasInIndexDefinitions, supportsSchemasInPrivilegeDefinitions, supportsSchemasInProcedureCalls, supportsSchemasInTableDefinitions, supportsSelectForUpdate, supportsStoredProcedures, supportsSubqueriesInComparisons, supportsSubqueriesInExists, supportsSubqueriesInIns, supportsSubqueriesInQuantifieds, supportsTableCorrelationNames, supportsTransactionIsolationLevel, supportsTransactions, supportsUnion, supportsUnionAll, updatesAreDetected, usesLocalFilePerTable, usesLocalFiles
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITCTX

public static final java.lang.String INITCTX
Constructor Detail

LDAPDatabaseMetaData

public LDAPDatabaseMetaData(MVAConnection connection,
                            java.util.Properties info)
                     throws java.sql.SQLException
Constructs LDAPDatabaseMetaData object.
Parameters:
connection - MVAConnection object.
info - Properties object containing LDAP information.
Throws:
java.sql.SQLException - This exception is required by the interface, but it is never thrown.
Method Detail

getTableTypes

public java.sql.ResultSet getTableTypes()
                                 throws java.sql.SQLException
Gets the table types available in LDAP. The results are ordered by table type.

The table type is:

Column nameData typeDescription
TYPEStringThe table type

Overrides:
getTableTypes in class MVADatabaseMetaData
Returns:
ResultSet in which each row has a single String column that is a table type.
Throws:
java.sql.SQLException - This exception may be thrown.

getTables

public java.sql.ResultSet getTables(java.lang.String catalog,
                                    java.lang.String schemaPattern,
                                    java.lang.String tableNamePattern,
                                    java.lang.String[] types)
                             throws java.sql.SQLException
Gets a description of the tables that are defined in LDAP.

Only table descriptions that match the catalog, schema, table name, and type criteria are returned. The rows are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.

Each table description contains the following columns:

Column nameData typeDescription
CATALOGStringThe table catalog (can be NULL)
SCHEMAStringThe table schema (can be NULL)
TABLEStringThe table name
TYPEStringThe table type
COMMENTString The tabledn
TABLE_PASSStringA non-standard column returning the password protection of the table. The returned column values would be one of NULL, READ, WRITE, ALTER values. A NULL is returned if no passwords are defined for the table. Since this is a non-standard result, this column must be referenced by name.

Overrides:
getTables in class MVADatabaseMetaData
Parameters:
catalog - A catalog name. An empty string ("") retrieves the rows that do not have a catalog.
schemaPattern - A schema name pattern. An empty string ("") retrieves the rows that do not have a schema.
tableNamePattern - A table name pattern.
types - A list of table types to include. A value of NULL returns all types.
Returns:
ResultSet in which each row is a table description.
Throws:
java.sql.SQLException - This exception is thrown if there is no connection to server or if an IO exception is detected.

getSchemas

public java.sql.ResultSet getSchemas()
                              throws java.sql.SQLException
Gets the schema names available in LDAP.

Each row of the result set contains the following columns:

Column nameData typeDescription
SCHEMAStringThe schema name

Overrides:
getSchemas in class MVADatabaseMetaData
Returns:
ResultSet in which each row has a single String column that is a schema name.
Throws:
java.sql.SQLException - This exception may be thrown.

getColumns

public java.sql.ResultSet getColumns(java.lang.String catalog,
                                     java.lang.String schemaPattern,
                                     java.lang.String tableNamePattern,
                                     java.lang.String columnNamePattern)
                              throws java.sql.SQLException
Gets a description of table columns available in LDAP.

Only column descriptions matching the catalog, schema, table and column name criteria are returned. The descriptions are ordered by TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION.

Each column description contains the following columns:

Column nameData typeDescription
CATALOGStringA table catalog (can be NULL)
SCHEMAStringA table schema (can be NULL)
TABLEStringA table name
NAMEStringA column name
SQLTYPEshortAn SQL type from java.sql.Types
TYPEStringA data-source-dependent format name including format width and decimal
SIZEintThe column size (For char or date types, this is the maximum number of characters; for numeric or decimal types, this is precision.)
EMPTYNULLNot used
SCALEintThe number of fractional digits
RADIXintThe radix (typically either 10 or 2)
NULLABLE intConstants that state whether NULL is allowed:
  • columnNoNulls - NULL values can possibly not be allowed
  • columnNullable - NULL values are allowed
  • columnNullableUnknown - Nullability is unknown
COMMENTStringThe columndn
DEFAULTStringThe default value (can be NULL)
EMPTY2intNot used
EMPTY3intNot used
MAXintFor char types, this is the maximum number of bytes in the column
POSITIONintThe index of the column in the table (starting at 1)
NOTKNOWNStringStrings that state whether NULL is allowed:
  • "NO" means that the column definitely does not allow NULL values
  • "YES" means that the column might allow NULL values
  • An empty string ("") means unknown

Overrides:
getColumns in class MVADatabaseMetaData
Parameters:
catalog - A catalog name. An empty string ("") retrieves the rows that do not have a catalog.
schemaPattern - A schema name pattern. An empty string ("") retrieves the rows that do not have a schema.
tableNamePattern - A table name pattern. For password protected tables the parameter will be of the form myTable(pw=XXXX).
columnNamePattern - A column name pattern.
Throws:
java.sql.SQLException - This exception may be thrown.