diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-02 12:00:25 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-04-02 12:00:36 +0200 |
commit | ee7c2171992514ed0b8b0f5bdbd8913f2c04db31 (patch) | |
tree | cb109c0f20d18e3d54037078b938b59ddfbd5e55 /sonar-core | |
parent | c758df02ed6c84bdeaff46aa9fc4648fd296c945 (diff) | |
download | sonarqube-ee7c2171992514ed0b8b0f5bdbd8913f2c04db31.tar.gz sonarqube-ee7c2171992514ed0b8b0f5bdbd8913f2c04db31.zip |
Fix usage of clob.free() on MsSQL
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/persistence/DbTester.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/DbTester.java b/sonar-core/src/test/java/org/sonar/core/persistence/DbTester.java index ecceaa474d7..a2dae090bdc 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/DbTester.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/DbTester.java @@ -234,7 +234,7 @@ public class DbTester extends ExternalResource { if (value instanceof Clob) { Clob clob = (Clob) value; value = IOUtils.toString((clob.getAsciiStream())); - clob.free(); + doClobFree(clob); } else if (value instanceof BigDecimal) { // In Oracle, INTEGER types are mapped as BigDecimal value = ((BigDecimal) value).longValue(); @@ -435,4 +435,12 @@ public class DbTester extends ExternalResource { IOUtils.closeQuietly(input); } } + + private static void doClobFree(Clob clob) throws SQLException { + try { + clob.free(); + } catch (AbstractMethodError e){ + // JTS driver do not implement free() as it's using JDBC 3.0 + } + } } |