20230629 java.sql.DatabaseMetaData
介绍
- java.sql.DatabaseMetaData
- public interface DatabaseMetaData extends Wrapper
- 数据库的元数据
API
常量
- procedureResultUnknown : 0
- procedureNoResult : 1
- procedureReturnsResult : 2
- procedureColumnUnknown : 0
- procedureColumnIn : 1
- procedureColumnInOut : 2
- procedureColumnOut : 4
- procedureColumnReturn : 5
- procedureColumnResult : 3
- procedureNoNulls : 0
- procedureNullable : 1
- procedureNullableUnknown : 2
- columnNoNulls : 0
- columnNullable : 1
- columnNullableUnknown : 2
- bestRowTemporary : 0
- bestRowTransaction : 1
- bestRowSession : 2
- bestRowUnknown : 0
- bestRowNotPseudo : 1
- bestRowPseudo : 2
- versionColumnUnknown : 0
- versionColumnNotPseudo : 1
- versionColumnPseudo : 2
- importedKeyCascade : 0
- importedKeyRestrict : 1
- importedKeySetNull : 2
- importedKeyNoAction : 3
- importedKeySetDefault : 4
- importedKeyInitiallyDeferred : 5
- importedKeyInitiallyImmediate : 6
- importedKeyNotDeferrable : 7
- typeNoNulls : 0
- typeNullable : 1
- typeNullableUnknown : 2
- typePredNone : 0
- typePredChar : 1
- typePredBasic : 2
- typeSearchable : 3
- tableIndexStatistic : 0
- tableIndexClustered : 1
- tableIndexHashed : 2
- tableIndexOther : 3
- attributeNoNulls : 0
- attributeNullable : 1
- attributeNullableUnknown : 2
- sqlStateXOpen : 1
- sqlStateSQL : 2
- sqlStateSQL99 : 2
- functionColumnUnknown : 0
- functionColumnIn : 1
- functionColumnInOut : 2
- functionColumnOut : 3
- functionReturn : 4
- functionColumnResult : 5
- functionNoNulls : 0
- functionNullable : 1
- functionNullableUnknown : 2
- functionResultUnknown : 0
- functionNoTable : 1
- functionReturnsTable : 2
public
-
getTables
- ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String types[]) throws SQLException;
- 返回某个目录 (catalog) 中所有表的描述,该目录必须匹配给定的模式 (schema) 、表名字模式以及类型标准。
- 模式用于描述一组相关的表和访问权限,而目录描述的是一组相关的模式
- catalog 和 schema 参数可以为
""
,用于检索那些没有目录或模式的表。如果不想考虑目录和模式,也可以将上述参数设为 null - types 数组包含了所需的表类型的名称,通常表类型有 "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM"。如果为 null ,则返回所有类型的表
- 返回的结果集有 5 列,均为 String 类型
- TABLE_CAT
- TABLE_SCHEM
- TABLE_NAME
- TABLE_TYPE
- REMARKS
-
getJDBCMajorVersion
-
getJDBCMinorVersion
- 建立数据库连接的 JDBC 驱动程序的主版本号和次版本号
- 例如,一个 JDBC 4.3 的驱动程序有一个主版本号4和次版本号3
-
getMaxConnections
- 返回可同时连接到数据库的最大并发连接数
-
getMaxStatements
- 返回单个数据库连接允许同时打开的最大并发语句数。如果对允许打开的语句数目没有限制或者不可知,则返回 0
-
allProceduresAreCallable
-
allTablesAreSelectable
-
autoCommitFailureClosesAllResultSets
-
dataDefinitionCausesTransactionCommit
-
dataDefinitionIgnoredInTransactions
-
deletesAreDetected
-
doesMaxRowSizeIncludeBlobs
-
generatedKeyAlwaysReturned
-
getAttributes
-
getBestRowIdentifier
-
getCatalogSeparator
-
getCatalogTerm
-
getCatalogs
-
getClientInfoProperties
-
getColumnPrivileges
-
getColumns
-
getConnection
-
getCrossReference
-
getDatabaseMajorVersion
-
getDatabaseMinorVersion
-
getDatabaseProductName
-
getDatabaseProductVersion
-
getDefaultTransactionIsolation
-
getDriverMajorVersion
-
getDriverMinorVersion
-
getDriverName
-
getDriverVersion
-
getExportedKeys
-
getExtraNameCharacters
-
getFunctionColumns
-
getFunctions
-
getIdentifierQuoteString
-
getImportedKeys
-
getIndexInfo
-
getMaxBinaryLiteralLength
-
getMaxCatalogNameLength
-
getMaxCharLiteralLength
-
getMaxColumnNameLength
-
getMaxColumnsInGroupBy
-
getMaxColumnsInIndex
-
getMaxColumnsInOrderBy
-
getMaxColumnsInSelect
-
getMaxColumnsInTable
-
getMaxCursorNameLength
-
getMaxIndexLength
-
getMaxLogicalLobSize
-
getMaxProcedureNameLength
-
getMaxRowSize
-
getMaxSchemaNameLength
-
getMaxStatementLength
-
getMaxTableNameLength
-
getMaxTablesInSelect
-
getMaxUserNameLength
-
getNumericFunctions
-
getPrimaryKeys
-
getProcedureColumns
-
getProcedureTerm
-
getProcedures
-
getPseudoColumns
-
getResultSetHoldability
-
getRowIdLifetime
-
getSQLKeywords
-
getSQLStateType
-
getSchemaTerm
-
getSchemas
-
getSearchStringEscape
-
getStringFunctions
-
getSuperTables
-
getSuperTypes
-
getSystemFunctions
-
getTablePrivileges
-
getTableTypes
-
getTimeDateFunctions
-
getTypeInfo
-
getUDTs
-
getURL
-
getUserName
-
getVersionColumns
-
insertsAreDetected
-
isCatalogAtStart
-
isReadOnly
-
locatorsUpdateCopy
-
nullPlusNonNullIsNull
-
nullsAreSortedAtEnd
-
nullsAreSortedAtStart
-
nullsAreSortedHigh
-
nullsAreSortedLow
-
othersDeletesAreVisible
-
othersInsertsAreVisible
-
othersUpdatesAreVisible
-
ownDeletesAreVisible
-
ownInsertsAreVisible
-
ownUpdatesAreVisible
-
storesLowerCaseIdentifiers
-
storesLowerCaseQuotedIdentifiers
-
storesMixedCaseIdentifiers
-
storesMixedCaseQuotedIdentifiers
-
storesUpperCaseIdentifiers
-
storesUpperCaseQuotedIdentifiers
-
updatesAreDetected
-
usesLocalFilePerTable
-
usesLocalFiles
support
-
supportsBatchUpdates
- 如果驱动程序支持批量更新,则返回 true
-
supportsANSI92EntryLevelSQL
-
supportsANSI92FullSQL
-
supportsANSI92IntermediateSQL
-
supportsAlterTableWithAddColumn
-
supportsAlterTableWithDropColumn
-
supportsCatalogsInDataManipulation
-
supportsCatalogsInIndexDefinitions
-
supportsCatalogsInPrivilegeDefinitions
-
supportsCatalogsInProcedureCalls
-
supportsCatalogsInTableDefinitions
-
supportsColumnAliasing
-
supportsConvert
-
supportsCoreSQLGrammar
-
supportsCorrelatedSubqueries
-
supportsDataDefinitionAndDataManipulationTransactions
-
supportsDataManipulationTransactionsOnly
-
supportsDifferentTableCorrelationNames
-
supportsExpressionsInOrderBy
-
supportsExtendedSQLGrammar
-
supportsFullOuterJoins
-
supportsGetGeneratedKeys
-
supportsGroupBy
-
supportsGroupByBeyondSelect
-
supportsGroupByUnrelated
-
supportsIntegrityEnhancementFacility
-
supportsLikeEscapeClause
-
supportsLimitedOuterJoins
-
supportsMinimumSQLGrammar
-
supportsMixedCaseIdentifiers
-
supportsMixedCaseQuotedIdentifiers
-
supportsMultipleOpenResults
-
supportsMultipleResultSets
-
supportsMultipleTransactions
-
supportsNamedParameters
-
supportsNonNullableColumns
-
supportsOpenCursorsAcrossCommit
-
supportsOpenCursorsAcrossRollback
-
supportsOpenStatementsAcrossCommit
-
supportsOpenStatementsAcrossRollback
-
supportsOrderByUnrelated
-
supportsOuterJoins
-
supportsPositionedDelete
-
supportsPositionedUpdate
-
supportsRefCursors
-
supportsResultSetConcurrency
-
supportsResultSetHoldability
-
supportsResultSetType
-
supportsSavepoints
-
supportsSchemasInDataManipulation
-
supportsSchemasInIndexDefinitions
-
supportsSchemasInPrivilegeDefinitions
-
supportsSchemasInProcedureCalls
-
supportsSchemasInTableDefinitions
-
supportsSelectForUpdate
-
supportsSharding
-
supportsStatementPooling
-
supportsStoredFunctionsUsingCallSyntax
-
supportsStoredProcedures
-
supportsSubqueriesInComparisons
-
supportsSubqueriesInExists
-
supportsSubqueriesInIns
-
supportsSubqueriesInQuantifieds
-
supportsTableCorrelationNames
-
supportsTransactionIsolationLevel
-
supportsTransactions
-
supportsUnion
-
supportsUnionAll