public abstract class ConnectionMatcher
extends java.lang.Object
There are static methods for creating the default types of matcher that we support.
| Constructor and Description |
|---|
ConnectionMatcher() |
| Modifier and Type | Method and Description |
|---|---|
static ConnectionMatcher |
matchAll(boolean and,
ConnectionMatcher... matchers)
Creates a matchers to matches all, or one of, of the given matchers.
|
static ConnectionMatcher |
matchDatabaseProductName(java.lang.String regex)
Creates a matcher that compares the database metadata product name
against the given regex.
|
static ConnectionMatcher |
matchDatabaseProductVersion(java.lang.String regex)
Creates a matcher that compares the database metadata product version
against the given regex.
|
static ConnectionMatcher |
matchDriverName(java.lang.String regex)
Creates a matchers that compares the JDBC driver name for the
given connection.
|
abstract boolean |
matches(java.sql.Connection conn)
Matches the given connection.
|
public abstract boolean matches(java.sql.Connection conn)
conn - the connection to matchpublic static ConnectionMatcher matchDatabaseProductName(java.lang.String regex)
regex - the expression to matchDatabaseMetaData.getDatabaseProductName()public static ConnectionMatcher matchDatabaseProductVersion(java.lang.String regex)
regex - the expression to matchDatabaseMetaData.getDatabaseProductVersion()public static ConnectionMatcher matchDriverName(java.lang.String regex)
regex - the regular expression to match the driver name topublic static ConnectionMatcher matchAll(boolean and, ConnectionMatcher... matchers)
and - true to match all matchers, false require a single matchmatchers - the child matchers