Skip to content
Snippets Groups Projects
Commit e438c4af authored by felmer's avatar felmer
Browse files

new attribute 'databaseVersion'

SVN: 2347
parent 78e3ab68
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ import ch.systemsx.cisd.common.exceptions.ConfigurationFailureException;
*/
public class DatabaseConfigurationContext
{
private String databaseVersion;
private String driver;
private LobHandler lobHandler;
......@@ -132,6 +134,31 @@ public class DatabaseConfigurationContext
return adminDataSource;
}
/**
* Returns the database version which should be used. If not set by {@link #setDatabaseVersion(String)}
* <code>defaultDatabaseVersion</code> will be returned.
*
* @throws ConfigurationFailureException if the database version is beyound the default one.
*/
public final String getDatabaseVersion(String defaultDatabaseVersion)
{
if (databaseVersion == null)
{
return defaultDatabaseVersion;
}
if (databaseVersion.compareTo(defaultDatabaseVersion) > 0)
{
throw new ConfigurationFailureException("Database version " + databaseVersion
+ " is not supported. Latest supported database version is " + defaultDatabaseVersion);
}
return databaseVersion;
}
public final void setDatabaseVersion(String databaseVersion)
{
this.databaseVersion = databaseVersion;
}
/**
* Returns the user name of the owner of the database.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment