-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDatabaseNotCompatibleException.java
More file actions
48 lines (36 loc) · 1.58 KB
/
DatabaseNotCompatibleException.java
File metadata and controls
48 lines (36 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package org.utplsql.api.exception;
import org.utplsql.api.Version;
import org.utplsql.api.compatibility.CompatibilityProxy;
import java.sql.SQLException;
/**
* Custom exception to indicate API is not compatible with database framework
*
* @author pesse
*/
public class DatabaseNotCompatibleException extends SQLException {
private final Version clientVersion;
private final Version databaseVersion;
public DatabaseNotCompatibleException(String message, Version clientVersion, Version databaseVersion, Throwable cause) {
super(message, cause);
this.clientVersion = clientVersion;
this.databaseVersion = databaseVersion;
}
public DatabaseNotCompatibleException(Version clientVersion, Version databaseVersion, Throwable cause) {
this("utPLSQL API (" + clientVersion + ") not compatible with database (" + databaseVersion + ")", clientVersion, databaseVersion, cause);
}
public DatabaseNotCompatibleException(Version clientVersion, Version databaseVersion) {
this(clientVersion, databaseVersion, null);
}
public DatabaseNotCompatibleException(Version databaseVersion, Throwable cause) {
this(Version.create(CompatibilityProxy.UTPLSQL_COMPATIBILITY_VERSION), databaseVersion, cause);
}
public DatabaseNotCompatibleException(Version databaseVersion) {
this(Version.create(CompatibilityProxy.UTPLSQL_COMPATIBILITY_VERSION), databaseVersion, null);
}
public Version getClientVersion() {
return clientVersion;
}
public Version getDatabaseVersion() {
return databaseVersion;
}
}