From 79f6ae2bb1d8feb8a3fb31184e0b316fef27e69c Mon Sep 17 00:00:00 2001 From: Liudmila Kornilova Date: Mon, 9 Sep 2019 12:54:12 +0300 Subject: [PATCH] CassandraResultSet.getString returns null value instead of string "null" --- build.gradle | 2 +- driver/src/main/java/com/dbschema/CassandraJdbcDriver.java | 2 +- driver/src/main/java/com/dbschema/CassandraResultSet.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 651bb33..91cada3 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' } -version '1.3.1' +version '1.3.2' sourceCompatibility = 1.8 diff --git a/driver/src/main/java/com/dbschema/CassandraJdbcDriver.java b/driver/src/main/java/com/dbschema/CassandraJdbcDriver.java index 6598f3e..d785b14 100644 --- a/driver/src/main/java/com/dbschema/CassandraJdbcDriver.java +++ b/driver/src/main/java/com/dbschema/CassandraJdbcDriver.java @@ -116,7 +116,7 @@ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) { } String getVersion() { - return "1.3.1"; + return "1.3.2"; } @Override diff --git a/driver/src/main/java/com/dbschema/CassandraResultSet.java b/driver/src/main/java/com/dbschema/CassandraResultSet.java index c3baa62..7344887 100644 --- a/driver/src/main/java/com/dbschema/CassandraResultSet.java +++ b/driver/src/main/java/com/dbschema/CassandraResultSet.java @@ -71,7 +71,8 @@ public boolean wasNull() { public String getString(int columnIndex) throws SQLException { checkClosed(); if (currentRow != null) { - return String.valueOf(currentRow.getObject(columnIndex - 1)); + Object object = currentRow.getObject(columnIndex - 1); + return object == null ? null : String.valueOf(object); } throw new SQLException("Exhausted ResultSet."); }