|
|
|
@ -35,6 +35,7 @@ import org.springframework.util.ClassUtils;
|
|
|
|
|
* @author Phillip Webb
|
|
|
|
|
* @author Dave Syer
|
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
|
* @author Nidhi Desai
|
|
|
|
|
* @since 1.0.0
|
|
|
|
|
* @see #get(ClassLoader)
|
|
|
|
|
*/
|
|
|
|
@ -58,8 +59,16 @@ public enum EmbeddedDatabaseConnection {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HSQL Database Connection.
|
|
|
|
|
* @deprecated since 2.4.0 in favor of {@link EmbeddedDatabaseConnection#HSQLDB}.
|
|
|
|
|
*/
|
|
|
|
|
@Deprecated
|
|
|
|
|
HSQL(EmbeddedDatabaseType.HSQL, DatabaseDriver.HSQLDB.getDriverClassName(), "org.hsqldb.jdbcDriver",
|
|
|
|
|
"jdbc:hsqldb:mem:%s"),
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* HSQL Database Connection.
|
|
|
|
|
*/
|
|
|
|
|
HSQLDB(EmbeddedDatabaseType.HSQL, DatabaseDriver.HSQLDB.getDriverClassName(), "org.hsqldb.jdbcDriver",
|
|
|
|
|
"jdbc:hsqldb:mem:%s");
|
|
|
|
|
|
|
|
|
|
private final EmbeddedDatabaseType type;
|
|
|
|
@ -114,8 +123,8 @@ public enum EmbeddedDatabaseConnection {
|
|
|
|
|
* @return true if the driver class is one of the embedded types
|
|
|
|
|
*/
|
|
|
|
|
public static boolean isEmbedded(String driverClass) {
|
|
|
|
|
return driverClass != null
|
|
|
|
|
&& (matches(HSQL, driverClass) || matches(H2, driverClass) || matches(DERBY, driverClass));
|
|
|
|
|
return driverClass != null && (matches(HSQL, driverClass) || matches(H2, driverClass)
|
|
|
|
|
|| matches(DERBY, driverClass) || matches(HSQLDB, driverClass));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static boolean matches(EmbeddedDatabaseConnection candidate, String driverClass) {
|
|
|
|
|