-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDatabaseNotCompatibleException.java
More file actions
55 lines (43 loc) · 1.66 KB
/
DatabaseNotCompatibleException.java
File metadata and controls
55 lines (43 loc) · 1.66 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
49
50
51
52
53
54
55
package org.utplsql.api.exception;
import org.utplsql.api.DBHelper;
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 Version clientVersion;
private 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 (" + String.valueOf(clientVersion) + ") not compatible with database (" + String.valueOf(databaseVersion) + ")", clientVersion, databaseVersion, cause);
}
public DatabaseNotCompatibleException( Version clientVersion, Version databaseVersion )
{
this(clientVersion, databaseVersion, null);
}
public DatabaseNotCompatibleException( Version databaseVersion, Throwable cause )
{
this(new Version(CompatibilityProxy.UTPLSQL_COMPATIBILITY_VERSION), databaseVersion, cause );
}
public DatabaseNotCompatibleException( Version databaseVersion )
{
this(new Version(CompatibilityProxy.UTPLSQL_COMPATIBILITY_VERSION), databaseVersion, null );
}
public Version getClientVersion() {
return clientVersion;
}
public Version getDatabaseVersion()
{
return databaseVersion;
}
}