public class DatabaseMetaDataWrapper extends Object
DatabaseMetaData class to provide some additional methods
for using database metadata.| Constructor and Description |
|---|
DatabaseMetaDataWrapper(DatabaseMetaData metaData)
Creates the wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isDatabaseCompatible(String databaseProductNameRegex,
DatabaseVersion minVersion,
DatabaseVersion maxVersion)
Compares database product name and version information to that reported
by the database.
|
boolean |
isDriverCompatible(String driverName,
DriverVersion minVersion,
DriverVersion maxVersion)
Compares JDBC driver name and version information to that reported
by the driver.
|
public DatabaseMetaDataWrapper(DatabaseMetaData metaData)
metaData - the DatabaseMetaData instance to wrap.public boolean isDatabaseCompatible(String databaseProductNameRegex, DatabaseVersion minVersion, DatabaseVersion maxVersion) throws SQLException
databaseProductNameRegex - a regular expression that the actual
database product name will match. Use a regular expression that is
unlikely to overlap with the product names of other database systems.minVersion - the expected minimum version, if any.maxVersion - the expected maximum version, if any.SQLException - if an error occurs fetching metadata containing the
database product name and version from the database.public boolean isDriverCompatible(String driverName, DriverVersion minVersion, DriverVersion maxVersion) throws SQLException
driverName - the expected driver name.minVersion - the expected minimum version, if any.maxVersion - the expected maximum version, if any.SQLException - if an error occurs fetching metadata containing the
JDBC driver name and version from the database.Copyright © 2012–2018 Emory University. All rights reserved.