@@ -33,6 +33,7 @@ import org.utplsql.sqldev.model.ut.OutputLines
33
33
34
34
class UtplsqlDao {
35
35
public static val UTPLSQL_PACKAGE_NAME = " UT"
36
+ public static val NOT_INSTALLED = 0000000
36
37
public static val FIRST_VERSION_WITH_INTERNAL_ANNOTATION_API = 3000004
37
38
public static val FIRST_VERSION_WITH_ANNOTATION_API = 3001003
38
39
public static val FIRST_VERSION_WITHOUT_INTERNAL_API = 3001008
@@ -60,14 +61,15 @@ class UtplsqlDao {
60
61
* returns a normalized utPLSQL version in format 9.9.9
61
62
*/
62
63
def String normalizedUtPlsqlVersion () {
63
- val p = Pattern . compile(" (\\ d+\\ .\\ d+\\ .\\ d+)" )
64
64
val version = getUtPlsqlVersion()
65
- val m = p. matcher(version)
66
- if (m. find) {
67
- return m. group(0 )
68
- } else {
69
- return " 0.0.0"
65
+ if (version !== null ) {
66
+ val p = Pattern . compile(" (\\ d+\\ .\\ d+\\ .\\ d+)" )
67
+ val m = p. matcher(version)
68
+ if (m. find) {
69
+ return m. group(0 )
70
+ }
70
71
}
72
+ return " 0.0.0"
71
73
}
72
74
73
75
/**
@@ -97,14 +99,20 @@ class UtplsqlDao {
97
99
? := ut.version;
98
100
END;
99
101
' ' '
100
- cachedUtPlsqlVersion = jdbcTemplate. execute(sql, new CallableStatementCallback<String > () {
101
- override String doInCallableStatement(CallableStatement cs) throws SQLException , DataAccessException {
102
- cs. registerOutParameter(1 , Types . VARCHAR );
103
- cs. execute
104
- val version = cs. getString(1 )
105
- return version
106
- }
107
- })
102
+ try {
103
+ cachedUtPlsqlVersion = jdbcTemplate. execute(sql, new CallableStatementCallback<String > () {
104
+ override String doInCallableStatement(CallableStatement cs) throws SQLException , DataAccessException {
105
+ cs. registerOutParameter(1 , Types . VARCHAR );
106
+ cs. execute
107
+ val version = cs. getString(1 )
108
+ return version
109
+ }
110
+ })
111
+ } catch (SQLException e) {
112
+ // ignore error
113
+ } catch (DataAccessException e) {
114
+ // ignore error
115
+ }
108
116
}
109
117
return cachedUtPlsqlVersion
110
118
}
0 commit comments