From a78329c3fe04e401a64a173ad223ae1c9fa17ca2 Mon Sep 17 00:00:00 2001 From: Muga Nishizawa Date: Fri, 2 Mar 2018 14:58:03 -0800 Subject: [PATCH] Support ResultSetMetaData#isReadOnly and isWritable methods --- .../com/treasuredata/jdbc/TDResultSetMetaData.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/treasuredata/jdbc/TDResultSetMetaData.java b/src/main/java/com/treasuredata/jdbc/TDResultSetMetaData.java index e17c618..200b4af 100644 --- a/src/main/java/com/treasuredata/jdbc/TDResultSetMetaData.java +++ b/src/main/java/com/treasuredata/jdbc/TDResultSetMetaData.java @@ -228,10 +228,18 @@ public int isNullable(int column) return ResultSetMetaData.columnNullable; } + /* + * Indicates whether the designated column is definitely not writable. + * We support to read column only via JDBC Driver for now. + * + * @param column the first column is 1, the second is 2, etc. + * @return true if so + * @exception SQLException if a database access error occurs + */ public boolean isReadOnly(int column) throws SQLException { - throw new SQLException("Method not supported"); + return true; } public boolean isSearchable(int column) @@ -280,7 +288,7 @@ else if ("float".equalsIgnoreCase(type) || public boolean isWritable(int column) throws SQLException { - throw new SQLException("Method not supported"); + return !isReadOnly(column); } public boolean isWrapperFor(Class iface)