提交 4c37daff 编写于 作者: Z zyyang

change

上级 a84e2aa4
...@@ -73,6 +73,12 @@ ...@@ -73,6 +73,12 @@
<version>1.2.58</version> <version>1.2.58</version>
</dependency> </dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
......
/***************************************************************************
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
package com.taosdata.jdbc;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractDatabaseMetaData implements DatabaseMetaData {
private final static String PRODUCT_NAME = "TDengine";
private final static String PRODUCT_VESION = "2.0.x.x";
private final static String DRIVER_NAME = "taos-jdbcdriver";
private final static String DRIVER_VERSION = "2.0.x";
private final static int DRIVER_MAJAR_VERSION = 2;
private final static int DRIVER_MINOR_VERSION = 0;
public boolean allProceduresAreCallable() throws SQLException {
return false;
}
public boolean allTablesAreSelectable() throws SQLException {
return false;
}
public abstract String getURL() throws SQLException;
public abstract String getUserName() throws SQLException;
public boolean isReadOnly() throws SQLException {
return false;
}
public boolean nullsAreSortedHigh() throws SQLException {
return false;
}
public boolean nullsAreSortedLow() throws SQLException {
return !nullsAreSortedHigh();
}
public boolean nullsAreSortedAtStart() throws SQLException {
return true;
}
public boolean nullsAreSortedAtEnd() throws SQLException {
return !nullsAreSortedAtStart();
}
public String getDatabaseProductName() throws SQLException {
return PRODUCT_NAME;
}
public String getDatabaseProductVersion() throws SQLException {
return PRODUCT_VESION;
}
public String getDriverName() throws SQLException {
return DRIVER_NAME;
}
public String getDriverVersion() throws SQLException {
return DRIVER_VERSION;
}
public int getDriverMajorVersion() {
return DRIVER_MAJAR_VERSION;
}
public int getDriverMinorVersion() {
return DRIVER_MINOR_VERSION;
}
public boolean usesLocalFiles() throws SQLException {
return false;
}
public boolean usesLocalFilePerTable() throws SQLException {
return false;
}
public boolean supportsMixedCaseIdentifiers() throws SQLException {
return false;
}
public boolean storesUpperCaseIdentifiers() throws SQLException {
return false;
}
public boolean storesLowerCaseIdentifiers() throws SQLException {
return false;
}
public boolean storesMixedCaseIdentifiers() throws SQLException {
return false;
}
public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
return false;
}
public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
return false;
}
public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
return false;
}
public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
return false;
}
public String getIdentifierQuoteString() throws SQLException {
return " ";
}
public String getSQLKeywords() throws SQLException {
return null;
}
public String getNumericFunctions() throws SQLException {
return null;
}
public String getStringFunctions() throws SQLException {
return null;
}
public String getSystemFunctions() throws SQLException {
return null;
}
public String getTimeDateFunctions() throws SQLException {
return null;
}
public String getSearchStringEscape() throws SQLException {
return null;
}
public String getExtraNameCharacters() throws SQLException {
return null;
}
public boolean supportsAlterTableWithAddColumn() throws SQLException {
return true;
}
public boolean supportsAlterTableWithDropColumn() throws SQLException {
return true;
}
public boolean supportsColumnAliasing() throws SQLException {
return true;
}
public boolean nullPlusNonNullIsNull() throws SQLException {
return false;
}
public boolean supportsConvert() throws SQLException {
return false;
}
public boolean supportsConvert(int fromType, int toType) throws SQLException {
return false;
}
public boolean supportsTableCorrelationNames() throws SQLException {
return false;
}
public boolean supportsDifferentTableCorrelationNames() throws SQLException {
return false;
}
public boolean supportsExpressionsInOrderBy() throws SQLException {
return false;
}
public boolean supportsOrderByUnrelated() throws SQLException {
return false;
}
public boolean supportsGroupBy() throws SQLException {
return false;
}
public boolean supportsGroupByUnrelated() throws SQLException {
return false;
}
public boolean supportsGroupByBeyondSelect() throws SQLException {
return false;
}
public boolean supportsLikeEscapeClause() throws SQLException {
return false;
}
public boolean supportsMultipleResultSets() throws SQLException {
return false;
}
public boolean supportsMultipleTransactions() throws SQLException {
return false;
}
public boolean supportsNonNullableColumns() throws SQLException {
return false;
}
public boolean supportsMinimumSQLGrammar() throws SQLException {
return false;
}
public boolean supportsCoreSQLGrammar() throws SQLException {
return false;
}
public boolean supportsExtendedSQLGrammar() throws SQLException {
return false;
}
public boolean supportsANSI92EntryLevelSQL() throws SQLException {
return false;
}
public boolean supportsANSI92IntermediateSQL() throws SQLException {
return false;
}
public boolean supportsANSI92FullSQL() throws SQLException {
return false;
}
public boolean supportsIntegrityEnhancementFacility() throws SQLException {
return false;
}
public boolean supportsOuterJoins() throws SQLException {
return false;
}
public boolean supportsFullOuterJoins() throws SQLException {
return false;
}
public boolean supportsLimitedOuterJoins() throws SQLException {
return false;
}
public String getSchemaTerm() throws SQLException {
return null;
}
public String getProcedureTerm() throws SQLException {
return null;
}
public String getCatalogTerm() throws SQLException {
return "database";
}
public boolean isCatalogAtStart() throws SQLException {
return true;
}
public String getCatalogSeparator() throws SQLException {
return ".";
}
public boolean supportsSchemasInDataManipulation() throws SQLException {
return false;
}
public boolean supportsSchemasInProcedureCalls() throws SQLException {
return false;
}
public boolean supportsSchemasInTableDefinitions() throws SQLException {
return false;
}
public boolean supportsSchemasInIndexDefinitions() throws SQLException {
return false;
}
public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
return false;
}
public boolean supportsCatalogsInDataManipulation() throws SQLException {
return true;
}
public boolean supportsCatalogsInProcedureCalls() throws SQLException {
return false;
}
public boolean supportsCatalogsInTableDefinitions() throws SQLException {
return false;
}
public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
return false;
}
public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
return false;
}
public boolean supportsPositionedDelete() throws SQLException {
return false;
}
public boolean supportsPositionedUpdate() throws SQLException {
return false;
}
public boolean supportsSelectForUpdate() throws SQLException {
return false;
}
public boolean supportsStoredProcedures() throws SQLException {
return false;
}
public boolean supportsSubqueriesInComparisons() throws SQLException {
return false;
}
public boolean supportsSubqueriesInExists() throws SQLException {
return false;
}
public boolean supportsSubqueriesInIns() throws SQLException {
return false;
}
public boolean supportsSubqueriesInQuantifieds() throws SQLException {
return false;
}
public boolean supportsCorrelatedSubqueries() throws SQLException {
return false;
}
public boolean supportsUnion() throws SQLException {
return false;
}
public boolean supportsUnionAll() throws SQLException {
return false;
}
public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
return false;
}
public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
return false;
}
public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
return false;
}
public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
return false;
}
public int getMaxBinaryLiteralLength() throws SQLException {
return 0;
}
public int getMaxCharLiteralLength() throws SQLException {
return 0;
}
public int getMaxColumnNameLength() throws SQLException {
return 0;
}
public int getMaxColumnsInGroupBy() throws SQLException {
return 0;
}
public int getMaxColumnsInIndex() throws SQLException {
return 0;
}
public int getMaxColumnsInOrderBy() throws SQLException {
return 0;
}
public int getMaxColumnsInSelect() throws SQLException {
return 0;
}
public int getMaxColumnsInTable() throws SQLException {
return 0;
}
public int getMaxConnections() throws SQLException {
return 0;
}
public int getMaxCursorNameLength() throws SQLException {
return 0;
}
public int getMaxIndexLength() throws SQLException {
return 0;
}
public int getMaxSchemaNameLength() throws SQLException {
return 0;
}
public int getMaxProcedureNameLength() throws SQLException {
return 0;
}
public int getMaxCatalogNameLength() throws SQLException {
return 0;
}
public int getMaxRowSize() throws SQLException {
return 0;
}
public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
return false;
}
public int getMaxStatementLength() throws SQLException {
return 0;
}
public int getMaxStatements() throws SQLException {
return 0;
}
public int getMaxTableNameLength() throws SQLException {
return 0;
}
public int getMaxTablesInSelect() throws SQLException {
return 0;
}
public int getMaxUserNameLength() throws SQLException {
return 0;
}
public int getDefaultTransactionIsolation() throws SQLException {
return 0;
}
public boolean supportsTransactions() throws SQLException {
return false;
}
public boolean supportsTransactionIsolationLevel(int level) throws SQLException {
return false;
}
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
return false;
}
public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
return false;
}
public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
return false;
}
public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
return false;
}
public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern)
throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
}
public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern,
String columnNamePattern) throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
}
public abstract ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)
throws SQLException;
public ResultSet getSchemas() throws SQLException {
return getEmptyResultSet();
}
public abstract ResultSet getCatalogs() throws SQLException;
public ResultSet getTableTypes() throws SQLException {
DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet();
// set up ColumnMetaDataList
List<ColumnMetaData> columnMetaDataList = new ArrayList<ColumnMetaData>(1);
ColumnMetaData colMetaData = new ColumnMetaData();
colMetaData.setColIndex(0);
colMetaData.setColName("TABLE_TYPE");
colMetaData.setColSize(10);
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY);
columnMetaDataList.add(colMetaData);
// set up rowDataList
List<TSDBResultSetRowData> rowDataList = new ArrayList<TSDBResultSetRowData>(2);
TSDBResultSetRowData rowData = new TSDBResultSetRowData();
rowData.setString(0, "TABLE");
rowDataList.add(rowData);
rowData = new TSDBResultSetRowData();
rowData.setString(0, "STABLE");
rowDataList.add(rowData);
resultSet.setColumnMetaDataList(columnMetaDataList);
resultSet.setRowDataList(rowDataList);
return resultSet;
}
public abstract ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException;
protected int getNullable(int index, String typeName) {
if (index == 0 && "TIMESTAMP".equals(typeName))
return DatabaseMetaData.columnNoNulls;
return DatabaseMetaData.columnNullable;
}
protected int getColumnSize(String typeName, int length) {
switch (typeName) {
case "TIMESTAMP":
return 23;
default:
return 0;
}
}
protected int getDecimalDigits(String typeName) {
switch (typeName) {
case "FLOAT":
return 5;
case "DOUBLE":
return 9;
default:
return 0;
}
}
protected int getDataType(String typeName) {
switch (typeName) {
case "TIMESTAMP":
return Types.TIMESTAMP;
case "INT":
return Types.INTEGER;
case "BIGINT":
return Types.BIGINT;
case "FLOAT":
return Types.FLOAT;
case "DOUBLE":
return Types.DOUBLE;
case "BINARY":
return Types.BINARY;
case "SMALLINT":
return Types.SMALLINT;
case "TINYINT":
return Types.TINYINT;
case "BOOL":
return Types.BOOLEAN;
case "NCHAR":
return Types.NCHAR;
default:
return Types.NULL;
}
}
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern)
throws SQLException {
return getEmptyResultSet();
}
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)
throws SQLException {
return getEmptyResultSet();
}
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)
throws SQLException {
return getEmptyResultSet();
}
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable,
String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getTypeInfo() throws SQLException {
return getEmptyResultSet();
}
public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)
throws SQLException {
return getEmptyResultSet();
}
public boolean supportsResultSetType(int type) throws SQLException {
return false;
}
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException {
return false;
}
public boolean ownUpdatesAreVisible(int type) throws SQLException {
return false;
}
public boolean ownDeletesAreVisible(int type) throws SQLException {
return false;
}
public boolean ownInsertsAreVisible(int type) throws SQLException {
return false;
}
public boolean othersUpdatesAreVisible(int type) throws SQLException {
return false;
}
public boolean othersDeletesAreVisible(int type) throws SQLException {
return false;
}
public boolean othersInsertsAreVisible(int type) throws SQLException {
return false;
}
public boolean updatesAreDetected(int type) throws SQLException {
return false;
}
public boolean deletesAreDetected(int type) throws SQLException {
return false;
}
public boolean insertsAreDetected(int type) throws SQLException {
return false;
}
public boolean supportsBatchUpdates() throws SQLException {
return false;
}
public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types)
throws SQLException {
return getEmptyResultSet();
}
public Connection getConnection() throws SQLException {
return null;
}
public boolean supportsSavepoints() throws SQLException {
return false;
}
public boolean supportsNamedParameters() throws SQLException {
return false;
}
public boolean supportsMultipleOpenResults() throws SQLException {
return false;
}
public boolean supportsGetGeneratedKeys() throws SQLException {
return false;
}
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern,
String attributeNamePattern) throws SQLException {
return getEmptyResultSet();
}
public boolean supportsResultSetHoldability(int holdability) throws SQLException {
return false;
}
public int getResultSetHoldability() throws SQLException {
return 0;
}
public int getDatabaseMajorVersion() throws SQLException {
return 0;
}
public int getDatabaseMinorVersion() throws SQLException {
return 0;
}
public int getJDBCMajorVersion() throws SQLException {
return 0;
}
public int getJDBCMinorVersion() throws SQLException {
return 0;
}
public int getSQLStateType() throws SQLException {
return 0;
}
public boolean locatorsUpdateCopy() throws SQLException {
return false;
}
public boolean supportsStatementPooling() throws SQLException {
return false;
}
public RowIdLifetime getRowIdLifetime() throws SQLException {
return null;
}
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
return null;
}
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
return false;
}
public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
return false;
}
public ResultSet getClientInfoProperties() throws SQLException {
return getEmptyResultSet();
}
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern)
throws SQLException {
return getEmptyResultSet();
}
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern,
String columnNamePattern) throws SQLException {
return getEmptyResultSet();
}
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern,
String columnNamePattern) throws SQLException {
return getEmptyResultSet();
}
public boolean generatedKeyAlwaysReturned() throws SQLException {
return false;
}
private ResultSet getEmptyResultSet() {
return new EmptyResultSet();
}
}
\ No newline at end of file
...@@ -46,6 +46,9 @@ public abstract class TSDBConstants { ...@@ -46,6 +46,9 @@ public abstract class TSDBConstants {
public static final int TSDB_DATA_TYPE_TIMESTAMP = 9; public static final int TSDB_DATA_TYPE_TIMESTAMP = 9;
public static final int TSDB_DATA_TYPE_NCHAR = 10; public static final int TSDB_DATA_TYPE_NCHAR = 10;
// nchar field's max length
public static final int maxFieldSize = 16 * 1024;
public static String WrapErrMsg(String msg) { public static String WrapErrMsg(String msg) {
return "TDengine Error: " + msg; return "TDengine Error: " + msg;
} }
......
package com.taosdata.jdbc.rs; package com.taosdata.jdbc.rs;
import com.taosdata.jdbc.TSDBConstants; import com.taosdata.jdbc.TSDBConstants;
import com.taosdata.jdbc.TSDBDriver;
import java.sql.*; import java.sql.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
...@@ -14,6 +17,11 @@ public class RestfulConnection implements Connection { ...@@ -14,6 +17,11 @@ public class RestfulConnection implements Connection {
private final Properties props; private final Properties props;
private final String database; private final String database;
private final String url; private final String url;
/******************************************************/
private boolean isClosed;
private DatabaseMetaData metadata;
private Map<String, Class<?>> typeMap;
private Properties clientInfoProps = new Properties();
public RestfulConnection(String host, String port, Properties props, String database, String url) { public RestfulConnection(String host, String port, Properties props, String database, String url) {
this.host = host; this.host = host;
...@@ -21,90 +29,94 @@ public class RestfulConnection implements Connection { ...@@ -21,90 +29,94 @@ public class RestfulConnection implements Connection {
this.props = props; this.props = props;
this.database = database; this.database = database;
this.url = url; this.url = url;
this.metadata = new RestfulDatabaseMetaData(url, props.getProperty(TSDBDriver.PROPERTY_KEY_USER), this);
} }
@Override @Override
public Statement createStatement() throws SQLException { public Statement createStatement() throws SQLException {
if (isClosed()) if (isClosed())
throw new SQLException(TSDBConstants.WrapErrMsg("restful TDengine connection is closed.")); throw new SQLException(TSDBConstants.WrapErrMsg("connection is closed."));
return new RestfulStatement(this, database); return new RestfulStatement(this, database);
} }
@Override @Override
public PreparedStatement prepareStatement(String sql) throws SQLException { public PreparedStatement prepareStatement(String sql) throws SQLException {
return null; //TODO: prepareStatement
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public CallableStatement prepareCall(String sql) throws SQLException { public CallableStatement prepareCall(String sql) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public String nativeSQL(String sql) throws SQLException { public String nativeSQL(String sql) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void setAutoCommit(boolean autoCommit) throws SQLException { public void setAutoCommit(boolean autoCommit) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean getAutoCommit() throws SQLException { public boolean getAutoCommit() throws SQLException {
return false; return true;
} }
@Override @Override
public void commit() throws SQLException { public void commit() throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void rollback() throws SQLException { public void rollback() throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
if (isClosed)
return;
//TODO: release all resources
isClosed = true;
} }
@Override @Override
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
return false; return isClosed;
} }
@Override @Override
public DatabaseMetaData getMetaData() throws SQLException { public DatabaseMetaData getMetaData() throws SQLException {
//TODO: RestfulDatabaseMetaData is not implemented //TODO: RestfulDatabaseMetaData is not implemented
return new RestfulDatabaseMetaData(); return this.metadata;
} }
@Override @Override
public void setReadOnly(boolean readOnly) throws SQLException { public void setReadOnly(boolean readOnly) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isReadOnly() throws SQLException { public boolean isReadOnly() throws SQLException {
return false; return true;
} }
@Override @Override
public void setCatalog(String catalog) throws SQLException { public void setCatalog(String catalog) throws SQLException {
//nothing to do
} }
@Override @Override
public String getCatalog() throws SQLException { public String getCatalog() throws SQLException {
return null; return this.database;
} }
@Override @Override
public void setTransactionIsolation(int level) throws SQLException { public void setTransactionIsolation(int level) throws SQLException {
//transaction is not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException("transactions are not supported");
} }
/** /**
...@@ -118,179 +130,212 @@ public class RestfulConnection implements Connection { ...@@ -118,179 +130,212 @@ public class RestfulConnection implements Connection {
@Override @Override
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
//TODO: getWarnings not implemented
return null; return null;
} }
@Override @Override
public void clearWarnings() throws SQLException { public void clearWarnings() throws SQLException {
throw new SQLFeatureNotSupportedException("clearWarnings not supported."); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
return null; if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
}
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY)
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
return createStatement();
} }
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
return null; if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) {
throw new SQLFeatureNotSupportedException(TSDBConstants.INVALID_VARIABLES);
}
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
throw new SQLFeatureNotSupportedException(TSDBConstants.INVALID_VARIABLES);
}
return this.prepareStatement(sql);
} }
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Map<String, Class<?>> getTypeMap() throws SQLException { public Map<String, Class<?>> getTypeMap() throws SQLException {
return null; synchronized (RestfulConnection.class) {
if (this.typeMap == null) {
this.typeMap = new HashMap<String, Class<?>>();
}
return this.typeMap;
}
} }
@Override @Override
public void setTypeMap(Map<String, Class<?>> map) throws SQLException { public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
synchronized (RestfulConnection.class) {
this.typeMap = map;
}
} }
@Override @Override
public void setHoldability(int holdability) throws SQLException { public void setHoldability(int holdability) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getHoldability() throws SQLException { public int getHoldability() throws SQLException {
return 0; return ResultSet.HOLD_CURSORS_OVER_COMMIT;
} }
@Override @Override
public Savepoint setSavepoint() throws SQLException { public Savepoint setSavepoint() throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Savepoint setSavepoint(String name) throws SQLException { public Savepoint setSavepoint(String name) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void rollback(Savepoint savepoint) throws SQLException { public void rollback(Savepoint savepoint) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void releaseSavepoint(Savepoint savepoint) throws SQLException { public void releaseSavepoint(Savepoint savepoint) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
return null; if (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT)
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
return createStatement(resultSetType, resultSetConcurrency);
} }
@Override @Override
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
return null; if (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT)
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
return prepareStatement(sql, resultSetType, resultSetConcurrency);
} }
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Clob createClob() throws SQLException { public Clob createClob() throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public Blob createBlob() throws SQLException { public Blob createBlob() throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public NClob createNClob() throws SQLException { public NClob createNClob() throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public SQLXML createSQLXML() throws SQLException { public SQLXML createSQLXML() throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public boolean isValid(int timeout) throws SQLException { public boolean isValid(int timeout) throws SQLException {
return false; if (timeout < 0)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
// TODO:
/* The driver shall submit a query on the connection or use some other mechanism that positively verifies
the connection is still valid when this method is called.*/
return !isClosed();
} }
@Override @Override
public void setClientInfo(String name, String value) throws SQLClientInfoException { public void setClientInfo(String name, String value) throws SQLClientInfoException {
clientInfoProps.setProperty(name, value);
} }
@Override @Override
public void setClientInfo(Properties properties) throws SQLClientInfoException { public void setClientInfo(Properties properties) throws SQLClientInfoException {
for (Enumeration<Object> enumer = properties.keys(); enumer.hasMoreElements(); ) {
String name = (String) enumer.nextElement();
clientInfoProps.put(name, properties.getProperty(name));
}
} }
@Override @Override
public String getClientInfo(String name) throws SQLException { public String getClientInfo(String name) throws SQLException {
return null; return clientInfoProps.getProperty(name);
} }
@Override @Override
public Properties getClientInfo() throws SQLException { public Properties getClientInfo() throws SQLException {
return null; return clientInfoProps;
} }
@Override @Override
public Array createArrayOf(String typeName, Object[] elements) throws SQLException { public Array createArrayOf(String typeName, Object[] elements) throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public Struct createStruct(String typeName, Object[] attributes) throws SQLException { public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
//TODO: not supported throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
throw new SQLFeatureNotSupportedException();
} }
@Override @Override
public void setSchema(String schema) throws SQLException { public void setSchema(String schema) throws SQLException {
//nothing to do
} }
@Override @Override
public String getSchema() throws SQLException { public String getSchema() throws SQLException {
return null; return this.database;
} }
@Override @Override
public void abort(Executor executor) throws SQLException { public void abort(Executor executor) throws SQLException {
if (executor == null) {
throw new SQLException("Executor can not be null");
}
executor.execute(() -> {
try {
close();
} catch (SQLException e) {
e.printStackTrace();
}
});
} }
@Override @Override
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
......
package com.taosdata.jdbc.rs; package com.taosdata.jdbc.rs;
import com.taosdata.jdbc.*;
import java.sql.*; import java.sql.*;
import java.util.ArrayList;
import java.util.List;
public class RestfulDatabaseMetaData implements DatabaseMetaData { public class RestfulDatabaseMetaData extends AbstractDatabaseMetaData {
@Override
public boolean allProceduresAreCallable() throws SQLException {
return false;
}
@Override private final String url;
public boolean allTablesAreSelectable() throws SQLException { private final String userName;
return false; private final Connection connection;
public RestfulDatabaseMetaData(String url, String userName, Connection connection) {
this.url = url;
this.userName = userName;
this.connection = connection;
} }
@Override @Override
public String getURL() throws SQLException { public String getURL() throws SQLException {
return null; return this.url;
} }
@Override @Override
public String getUserName() throws SQLException { public String getUserName() throws SQLException {
return null; return this.userName;
}
@Override
public boolean isReadOnly() throws SQLException {
return false;
}
@Override
public boolean nullsAreSortedHigh() throws SQLException {
return false;
}
@Override
public boolean nullsAreSortedLow() throws SQLException {
return false;
}
@Override
public boolean nullsAreSortedAtStart() throws SQLException {
return false;
}
@Override
public boolean nullsAreSortedAtEnd() throws SQLException {
return false;
}
@Override
public String getDatabaseProductName() throws SQLException {
return null;
}
@Override
public String getDatabaseProductVersion() throws SQLException {
return null;
}
@Override
public String getDriverName() throws SQLException {
return null;
}
@Override
public String getDriverVersion() throws SQLException {
return null;
}
@Override
public int getDriverMajorVersion() {
return 0;
}
@Override
public int getDriverMinorVersion() {
return 0;
}
@Override
public boolean usesLocalFiles() throws SQLException {
return false;
}
@Override
public boolean usesLocalFilePerTable() throws SQLException {
return false;
}
@Override
public boolean supportsMixedCaseIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesUpperCaseIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesLowerCaseIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesMixedCaseIdentifiers() throws SQLException {
return false;
}
@Override
public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
return false;
}
@Override
public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
return false;
}
@Override
public String getIdentifierQuoteString() throws SQLException {
return null;
}
@Override
public String getSQLKeywords() throws SQLException {
return null;
}
@Override
public String getNumericFunctions() throws SQLException {
return null;
}
@Override
public String getStringFunctions() throws SQLException {
return null;
}
@Override
public String getSystemFunctions() throws SQLException {
return null;
}
@Override
public String getTimeDateFunctions() throws SQLException {
return null;
}
@Override
public String getSearchStringEscape() throws SQLException {
return null;
}
@Override
public String getExtraNameCharacters() throws SQLException {
return null;
}
@Override
public boolean supportsAlterTableWithAddColumn() throws SQLException {
return false;
}
@Override
public boolean supportsAlterTableWithDropColumn() throws SQLException {
return false;
}
@Override
public boolean supportsColumnAliasing() throws SQLException {
return false;
}
@Override
public boolean nullPlusNonNullIsNull() throws SQLException {
return false;
}
@Override
public boolean supportsConvert() throws SQLException {
return false;
}
@Override
public boolean supportsConvert(int fromType, int toType) throws SQLException {
return false;
}
@Override
public boolean supportsTableCorrelationNames() throws SQLException {
return false;
}
@Override
public boolean supportsDifferentTableCorrelationNames() throws SQLException {
return false;
}
@Override
public boolean supportsExpressionsInOrderBy() throws SQLException {
return false;
}
@Override
public boolean supportsOrderByUnrelated() throws SQLException {
return false;
}
@Override
public boolean supportsGroupBy() throws SQLException {
return false;
}
@Override
public boolean supportsGroupByUnrelated() throws SQLException {
return false;
}
@Override
public boolean supportsGroupByBeyondSelect() throws SQLException {
return false;
}
@Override
public boolean supportsLikeEscapeClause() throws SQLException {
return false;
}
@Override
public boolean supportsMultipleResultSets() throws SQLException {
return false;
}
@Override
public boolean supportsMultipleTransactions() throws SQLException {
return false;
}
@Override
public boolean supportsNonNullableColumns() throws SQLException {
return false;
}
@Override
public boolean supportsMinimumSQLGrammar() throws SQLException {
return false;
}
@Override
public boolean supportsCoreSQLGrammar() throws SQLException {
return false;
}
@Override
public boolean supportsExtendedSQLGrammar() throws SQLException {
return false;
}
@Override
public boolean supportsANSI92EntryLevelSQL() throws SQLException {
return false;
}
@Override
public boolean supportsANSI92IntermediateSQL() throws SQLException {
return false;
}
@Override
public boolean supportsANSI92FullSQL() throws SQLException {
return false;
}
@Override
public boolean supportsIntegrityEnhancementFacility() throws SQLException {
return false;
}
@Override
public boolean supportsOuterJoins() throws SQLException {
return false;
}
@Override
public boolean supportsFullOuterJoins() throws SQLException {
return false;
}
@Override
public boolean supportsLimitedOuterJoins() throws SQLException {
return false;
} }
@Override @Override
...@@ -325,554 +50,149 @@ public class RestfulDatabaseMetaData implements DatabaseMetaData { ...@@ -325,554 +50,149 @@ public class RestfulDatabaseMetaData implements DatabaseMetaData {
} }
@Override @Override
public String getCatalogSeparator() throws SQLException { public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
return null; Statement stmt = null;
} if (null != connection && !connection.isClosed()) {
stmt = connection.createStatement();
@Override if (catalog == null || catalog.length() < 1) {
public boolean supportsSchemasInDataManipulation() throws SQLException { catalog = connection.getCatalog();
return false;
}
@Override
public boolean supportsSchemasInProcedureCalls() throws SQLException {
return false;
} }
stmt.executeUpdate("use " + catalog);
@Override ResultSet resultSet0 = stmt.executeQuery("show tables");
public boolean supportsSchemasInTableDefinitions() throws SQLException { GetTablesResultSet getTablesResultSet = new GetTablesResultSet(resultSet0, catalog, schemaPattern, tableNamePattern, types);
return false; return getTablesResultSet;
} else {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL));
} }
@Override
public boolean supportsSchemasInIndexDefinitions() throws SQLException {
return false;
} }
@Override @Override
public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException { public ResultSet getCatalogs() throws SQLException {
return false; if (connection != null && !connection.isClosed()) {
Statement stmt = connection.createStatement();
ResultSet resultSet0 = stmt.executeQuery("show databases");
CatalogResultSet resultSet = new CatalogResultSet(resultSet0);
return resultSet;
} else {
return new EmptyResultSet();
} }
@Override
public boolean supportsCatalogsInDataManipulation() throws SQLException {
return false;
} }
@Override @Override
public boolean supportsCatalogsInProcedureCalls() throws SQLException { public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
Statement stmt = null;
if (null != connection && !connection.isClosed()) {
stmt = connection.createStatement();
if (catalog == null || catalog.length() < 1) {
catalog = connection.getCatalog();
}
stmt.execute("use " + catalog);
DatabaseMetaDataResultSet resultSet = new DatabaseMetaDataResultSet();
// set up ColumnMetaDataList
List<ColumnMetaData> columnMetaDataList = new ArrayList<>(24);
columnMetaDataList.add(null);
columnMetaDataList.add(null);
// add TABLE_NAME
ColumnMetaData colMetaData = new ColumnMetaData();
colMetaData.setColIndex(3);
colMetaData.setColName("TABLE_NAME");
colMetaData.setColSize(193);
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY);
columnMetaDataList.add(colMetaData);
// add COLUMN_NAME
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(4);
colMetaData.setColName("COLUMN_NAME");
colMetaData.setColSize(65);
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY);
columnMetaDataList.add(colMetaData);
// add DATA_TYPE
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(5);
colMetaData.setColName("DATA_TYPE");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT);
columnMetaDataList.add(colMetaData);
// add TYPE_NAME
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(6);
colMetaData.setColName("TYPE_NAME");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_BINARY);
columnMetaDataList.add(colMetaData);
// add COLUMN_SIZE
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(7);
colMetaData.setColName("COLUMN_SIZE");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT);
columnMetaDataList.add(colMetaData);
// add BUFFER_LENGTH ,not used
columnMetaDataList.add(null);
// add DECIMAL_DIGITS
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(9);
colMetaData.setColName("DECIMAL_DIGITS");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT);
columnMetaDataList.add(colMetaData);
// add NUM_PREC_RADIX
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(10);
colMetaData.setColName("NUM_PREC_RADIX");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT);
columnMetaDataList.add(colMetaData);
// add NULLABLE
colMetaData = new ColumnMetaData();
colMetaData.setColIndex(11);
colMetaData.setColName("NULLABLE");
colMetaData.setColType(TSDBConstants.TSDB_DATA_TYPE_INT);
columnMetaDataList.add(colMetaData);
resultSet.setColumnMetaDataList(columnMetaDataList);
// set up rowDataList
ResultSet resultSet0 = stmt.executeQuery("describe " + tableNamePattern);
List<TSDBResultSetRowData> rowDataList = new ArrayList<>();
int index = 0;
while (resultSet0.next()) {
TSDBResultSetRowData rowData = new TSDBResultSetRowData(24);
// set TABLE_NAME
rowData.setString(2, tableNamePattern);
// set COLUMN_NAME
rowData.setString(3, resultSet0.getString(1));
// set DATA_TYPE
String typeName = resultSet0.getString(2);
rowData.setInt(4, getDataType(typeName));
// set TYPE_NAME
rowData.setString(5, typeName);
// set COLUMN_SIZE
int length = resultSet0.getInt(3);
rowData.setInt(6, getColumnSize(typeName, length));
// set DECIMAL_DIGITS
rowData.setInt(8, getDecimalDigits(typeName));
// set NUM_PREC_RADIX
rowData.setInt(9, 10);
// set NULLABLE
rowData.setInt(10, getNullable(index, typeName));
rowDataList.add(rowData);
index++;
}
resultSet.setRowDataList(rowDataList);
return resultSet;
} else {
throw new SQLException(TSDBConstants.FixErrMsg(TSDBConstants.JNI_CONNECTION_NULL));
}
}
@Override
public long getMaxLogicalLobSize() throws SQLException {
return 0;
}
@Override
public boolean supportsRefCursors() throws SQLException {
return false; return false;
} }
@Override
public boolean supportsCatalogsInTableDefinitions() throws SQLException {
return false;
}
@Override
public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
return false;
}
@Override
public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
return false;
}
@Override
public boolean supportsPositionedDelete() throws SQLException {
return false;
}
@Override
public boolean supportsPositionedUpdate() throws SQLException {
return false;
}
@Override
public boolean supportsSelectForUpdate() throws SQLException {
return false;
}
@Override
public boolean supportsStoredProcedures() throws SQLException {
return false;
}
@Override
public boolean supportsSubqueriesInComparisons() throws SQLException {
return false;
}
@Override
public boolean supportsSubqueriesInExists() throws SQLException {
return false;
}
@Override
public boolean supportsSubqueriesInIns() throws SQLException {
return false;
}
@Override
public boolean supportsSubqueriesInQuantifieds() throws SQLException {
return false;
}
@Override
public boolean supportsCorrelatedSubqueries() throws SQLException {
return false;
}
@Override
public boolean supportsUnion() throws SQLException {
return false;
}
@Override
public boolean supportsUnionAll() throws SQLException {
return false;
}
@Override
public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
return false;
}
@Override
public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
return false;
}
@Override
public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
return false;
}
@Override
public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
return false;
}
@Override
public int getMaxBinaryLiteralLength() throws SQLException {
return 0;
}
@Override
public int getMaxCharLiteralLength() throws SQLException {
return 0;
}
@Override
public int getMaxColumnNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxColumnsInGroupBy() throws SQLException {
return 0;
}
@Override
public int getMaxColumnsInIndex() throws SQLException {
return 0;
}
@Override
public int getMaxColumnsInOrderBy() throws SQLException {
return 0;
}
@Override
public int getMaxColumnsInSelect() throws SQLException {
return 0;
}
@Override
public int getMaxColumnsInTable() throws SQLException {
return 0;
}
@Override
public int getMaxConnections() throws SQLException {
return 0;
}
@Override
public int getMaxCursorNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxIndexLength() throws SQLException {
return 0;
}
@Override
public int getMaxSchemaNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxProcedureNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxCatalogNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxRowSize() throws SQLException {
return 0;
}
@Override
public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
return false;
}
@Override
public int getMaxStatementLength() throws SQLException {
return 0;
}
@Override
public int getMaxStatements() throws SQLException {
return 0;
}
@Override
public int getMaxTableNameLength() throws SQLException {
return 0;
}
@Override
public int getMaxTablesInSelect() throws SQLException {
return 0;
}
@Override
public int getMaxUserNameLength() throws SQLException {
return 0;
}
@Override
public int getDefaultTransactionIsolation() throws SQLException {
return 0;
}
@Override
public boolean supportsTransactions() throws SQLException {
return false;
}
@Override
public boolean supportsTransactionIsolationLevel(int level) throws SQLException {
return false;
}
@Override
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
return false;
}
@Override
public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
return false;
}
@Override
public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
return false;
}
@Override
public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
return false;
}
@Override
public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
return null;
}
@Override
public ResultSet getSchemas() throws SQLException {
return null;
}
@Override
public ResultSet getCatalogs() throws SQLException {
return null;
}
@Override
public ResultSet getTableTypes() throws SQLException {
return null;
}
@Override
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException {
return null;
}
@Override
public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException {
return null;
}
@Override
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
return null;
}
@Override
public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException {
return null;
}
@Override
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
return null;
}
@Override
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException {
return null;
}
@Override
public ResultSet getTypeInfo() throws SQLException {
return null;
}
@Override
public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException {
return null;
}
@Override
public boolean supportsResultSetType(int type) throws SQLException {
return false;
}
@Override
public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException {
return false;
}
@Override
public boolean ownUpdatesAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean ownDeletesAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean ownInsertsAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean othersUpdatesAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean othersDeletesAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean othersInsertsAreVisible(int type) throws SQLException {
return false;
}
@Override
public boolean updatesAreDetected(int type) throws SQLException {
return false;
}
@Override
public boolean deletesAreDetected(int type) throws SQLException {
return false;
}
@Override
public boolean insertsAreDetected(int type) throws SQLException {
return false;
}
@Override
public boolean supportsBatchUpdates() throws SQLException {
return false;
}
@Override
public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException {
return null;
}
@Override
public Connection getConnection() throws SQLException {
return null;
}
@Override
public boolean supportsSavepoints() throws SQLException {
return false;
}
@Override
public boolean supportsNamedParameters() throws SQLException {
return false;
}
@Override
public boolean supportsMultipleOpenResults() throws SQLException {
return false;
}
@Override
public boolean supportsGetGeneratedKeys() throws SQLException {
return false;
}
@Override
public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException {
return null;
}
@Override
public boolean supportsResultSetHoldability(int holdability) throws SQLException {
return false;
}
@Override
public int getResultSetHoldability() throws SQLException {
return 0;
}
@Override
public int getDatabaseMajorVersion() throws SQLException {
return 0;
}
@Override
public int getDatabaseMinorVersion() throws SQLException {
return 0;
}
@Override
public int getJDBCMajorVersion() throws SQLException {
return 0;
}
@Override
public int getJDBCMinorVersion() throws SQLException {
return 0;
}
@Override
public int getSQLStateType() throws SQLException {
return 0;
}
@Override
public boolean locatorsUpdateCopy() throws SQLException {
return false;
}
@Override
public boolean supportsStatementPooling() throws SQLException {
return false;
}
@Override
public RowIdLifetime getRowIdLifetime() throws SQLException {
return null;
}
@Override
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException {
return null;
}
@Override
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
return false;
}
@Override
public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
return false;
}
@Override
public ResultSet getClientInfoProperties() throws SQLException {
return null;
}
@Override
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException {
return null;
}
@Override
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
return null;
}
@Override
public boolean generatedKeyAlwaysReturned() throws SQLException {
return false;
}
@Override @Override
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
......
...@@ -33,7 +33,7 @@ public class RestfulDriver extends AbstractTaosDriver { ...@@ -33,7 +33,7 @@ public class RestfulDriver extends AbstractTaosDriver {
return null; return null;
Properties props = parseURL(url, info); Properties props = parseURL(url, info);
String host = props.getProperty(TSDBDriver.PROPERTY_KEY_HOST, "localhost"); String host = props.getProperty(TSDBDriver.PROPERTY_KEY_HOST);
String port = props.getProperty(TSDBDriver.PROPERTY_KEY_PORT, "6041"); String port = props.getProperty(TSDBDriver.PROPERTY_KEY_PORT, "6041");
String database = props.containsKey(TSDBDriver.PROPERTY_KEY_DBNAME) ? props.getProperty(TSDBDriver.PROPERTY_KEY_DBNAME) : null; String database = props.containsKey(TSDBDriver.PROPERTY_KEY_DBNAME) ? props.getProperty(TSDBDriver.PROPERTY_KEY_DBNAME) : null;
......
package com.taosdata.jdbc.rs; package com.taosdata.jdbc.rs;
import com.alibaba.fastjson.JSONArray;
import com.taosdata.jdbc.TSDBConstants; import com.taosdata.jdbc.TSDBConstants;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -38,6 +39,12 @@ public class RestfulResultSet implements ResultSet { ...@@ -38,6 +39,12 @@ public class RestfulResultSet implements ResultSet {
} }
} }
public RestfulResultSet(JSONArray data, JSONArray head) {
for (int i = 0; i < data.size(); i++) {
}
}
@Override @Override
public boolean next() throws SQLException { public boolean next() throws SQLException {
if (isClosed) throw new SQLException(TSDBConstants.WrapErrMsg("Result is Closed!!!")); if (isClosed) throw new SQLException(TSDBConstants.WrapErrMsg("Result is Closed!!!"));
...@@ -78,7 +85,7 @@ public class RestfulResultSet implements ResultSet { ...@@ -78,7 +85,7 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public byte getByte(int columnIndex) throws SQLException { public byte getByte(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -113,25 +120,25 @@ public class RestfulResultSet implements ResultSet { ...@@ -113,25 +120,25 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public byte[] getBytes(int columnIndex) throws SQLException { public byte[] getBytes(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Date getDate(int columnIndex) throws SQLException { public Date getDate(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Time getTime(int columnIndex) throws SQLException { public Time getTime(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -144,19 +151,19 @@ public class RestfulResultSet implements ResultSet { ...@@ -144,19 +151,19 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public InputStream getAsciiStream(int columnIndex) throws SQLException { public InputStream getAsciiStream(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public InputStream getUnicodeStream(int columnIndex) throws SQLException { public InputStream getUnicodeStream(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public InputStream getBinaryStream(int columnIndex) throws SQLException { public InputStream getBinaryStream(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -244,20 +251,20 @@ public class RestfulResultSet implements ResultSet { ...@@ -244,20 +251,20 @@ public class RestfulResultSet implements ResultSet {
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
return null; return null;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
// throw new SQLFeatureNotSupportedException(); // throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void clearWarnings() throws SQLException { public void clearWarnings() throws SQLException {
return; return;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
// throw new SQLFeatureNotSupportedException(); // throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public String getCursorName() throws SQLException { public String getCursorName() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -269,14 +276,14 @@ public class RestfulResultSet implements ResultSet { ...@@ -269,14 +276,14 @@ public class RestfulResultSet implements ResultSet {
public Object getObject(int columnIndex) throws SQLException { public Object getObject(int columnIndex) throws SQLException {
// return null; // return null;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Object getObject(String columnLabel) throws SQLException { public Object getObject(String columnLabel) throws SQLException {
// return null; // return null;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -287,439 +294,439 @@ public class RestfulResultSet implements ResultSet { ...@@ -287,439 +294,439 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public Reader getCharacterStream(int columnIndex) throws SQLException { public Reader getCharacterStream(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Reader getCharacterStream(String columnLabel) throws SQLException { public Reader getCharacterStream(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public BigDecimal getBigDecimal(int columnIndex) throws SQLException { public BigDecimal getBigDecimal(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public BigDecimal getBigDecimal(String columnLabel) throws SQLException { public BigDecimal getBigDecimal(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isBeforeFirst() throws SQLException { public boolean isBeforeFirst() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isAfterLast() throws SQLException { public boolean isAfterLast() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isFirst() throws SQLException { public boolean isFirst() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isLast() throws SQLException { public boolean isLast() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void beforeFirst() throws SQLException { public void beforeFirst() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void afterLast() throws SQLException { public void afterLast() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean first() throws SQLException { public boolean first() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean last() throws SQLException { public boolean last() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getRow() throws SQLException { public int getRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean absolute(int row) throws SQLException { public boolean absolute(int row) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean relative(int rows) throws SQLException { public boolean relative(int rows) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean previous() throws SQLException { public boolean previous() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void setFetchDirection(int direction) throws SQLException { public void setFetchDirection(int direction) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getFetchDirection() throws SQLException { public int getFetchDirection() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void setFetchSize(int rows) throws SQLException { public void setFetchSize(int rows) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getFetchSize() throws SQLException { public int getFetchSize() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getType() throws SQLException { public int getType() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getConcurrency() throws SQLException { public int getConcurrency() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean rowUpdated() throws SQLException { public boolean rowUpdated() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean rowInserted() throws SQLException { public boolean rowInserted() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean rowDeleted() throws SQLException { public boolean rowDeleted() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNull(int columnIndex) throws SQLException { public void updateNull(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBoolean(int columnIndex, boolean x) throws SQLException { public void updateBoolean(int columnIndex, boolean x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateByte(int columnIndex, byte x) throws SQLException { public void updateByte(int columnIndex, byte x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateShort(int columnIndex, short x) throws SQLException { public void updateShort(int columnIndex, short x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateInt(int columnIndex, int x) throws SQLException { public void updateInt(int columnIndex, int x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateLong(int columnIndex, long x) throws SQLException { public void updateLong(int columnIndex, long x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateFloat(int columnIndex, float x) throws SQLException { public void updateFloat(int columnIndex, float x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateDouble(int columnIndex, double x) throws SQLException { public void updateDouble(int columnIndex, double x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateString(int columnIndex, String x) throws SQLException { public void updateString(int columnIndex, String x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBytes(int columnIndex, byte[] x) throws SQLException { public void updateBytes(int columnIndex, byte[] x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateDate(int columnIndex, Date x) throws SQLException { public void updateDate(int columnIndex, Date x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateTime(int columnIndex, Time x) throws SQLException { public void updateTime(int columnIndex, Time x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException { public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException { public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException { public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException { public void updateObject(int columnIndex, Object x, int scaleOrLength) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateObject(int columnIndex, Object x) throws SQLException { public void updateObject(int columnIndex, Object x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNull(String columnLabel) throws SQLException { public void updateNull(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBoolean(String columnLabel, boolean x) throws SQLException { public void updateBoolean(String columnLabel, boolean x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateByte(String columnLabel, byte x) throws SQLException { public void updateByte(String columnLabel, byte x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateShort(String columnLabel, short x) throws SQLException { public void updateShort(String columnLabel, short x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateInt(String columnLabel, int x) throws SQLException { public void updateInt(String columnLabel, int x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateLong(String columnLabel, long x) throws SQLException { public void updateLong(String columnLabel, long x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateFloat(String columnLabel, float x) throws SQLException { public void updateFloat(String columnLabel, float x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateDouble(String columnLabel, double x) throws SQLException { public void updateDouble(String columnLabel, double x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException { public void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateString(String columnLabel, String x) throws SQLException { public void updateString(String columnLabel, String x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBytes(String columnLabel, byte[] x) throws SQLException { public void updateBytes(String columnLabel, byte[] x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateDate(String columnLabel, Date x) throws SQLException { public void updateDate(String columnLabel, Date x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateTime(String columnLabel, Time x) throws SQLException { public void updateTime(String columnLabel, Time x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException { public void updateTimestamp(String columnLabel, Timestamp x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException { public void updateAsciiStream(String columnLabel, InputStream x, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException { public void updateBinaryStream(String columnLabel, InputStream x, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException { public void updateCharacterStream(String columnLabel, Reader reader, int length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException { public void updateObject(String columnLabel, Object x, int scaleOrLength) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateObject(String columnLabel, Object x) throws SQLException { public void updateObject(String columnLabel, Object x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void insertRow() throws SQLException { public void insertRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateRow() throws SQLException { public void updateRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void deleteRow() throws SQLException { public void deleteRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void refreshRow() throws SQLException { public void refreshRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void cancelRowUpdates() throws SQLException { public void cancelRowUpdates() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void moveToInsertRow() throws SQLException { public void moveToInsertRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void moveToCurrentRow() throws SQLException { public void moveToCurrentRow() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Statement getStatement() throws SQLException { public Statement getStatement() throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException { public Object getObject(int columnIndex, Map<String, Class<?>> map) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Ref getRef(int columnIndex) throws SQLException { public Ref getRef(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -730,145 +737,145 @@ public class RestfulResultSet implements ResultSet { ...@@ -730,145 +737,145 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public Clob getClob(int columnIndex) throws SQLException { public Clob getClob(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Array getArray(int columnIndex) throws SQLException { public Array getArray(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException { public Object getObject(String columnLabel, Map<String, Class<?>> map) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Ref getRef(String columnLabel) throws SQLException { public Ref getRef(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Blob getBlob(String columnLabel) throws SQLException { public Blob getBlob(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Clob getClob(String columnLabel) throws SQLException { public Clob getClob(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Array getArray(String columnLabel) throws SQLException { public Array getArray(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Date getDate(int columnIndex, Calendar cal) throws SQLException { public Date getDate(int columnIndex, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Date getDate(String columnLabel, Calendar cal) throws SQLException { public Date getDate(String columnLabel, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Time getTime(int columnIndex, Calendar cal) throws SQLException { public Time getTime(int columnIndex, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Time getTime(String columnLabel, Calendar cal) throws SQLException { public Time getTime(String columnLabel, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException { public Timestamp getTimestamp(String columnLabel, Calendar cal) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public URL getURL(int columnIndex) throws SQLException { public URL getURL(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public URL getURL(String columnLabel) throws SQLException { public URL getURL(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateRef(int columnIndex, Ref x) throws SQLException { public void updateRef(int columnIndex, Ref x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateRef(String columnLabel, Ref x) throws SQLException { public void updateRef(String columnLabel, Ref x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(int columnIndex, Blob x) throws SQLException { public void updateBlob(int columnIndex, Blob x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(String columnLabel, Blob x) throws SQLException { public void updateBlob(String columnLabel, Blob x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(int columnIndex, Clob x) throws SQLException { public void updateClob(int columnIndex, Clob x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(String columnLabel, Clob x) throws SQLException { public void updateClob(String columnLabel, Clob x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateArray(int columnIndex, Array x) throws SQLException { public void updateArray(int columnIndex, Array x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateArray(String columnLabel, Array x) throws SQLException { public void updateArray(String columnLabel, Array x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public RowId getRowId(int columnIndex) throws SQLException { public RowId getRowId(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -879,302 +886,302 @@ public class RestfulResultSet implements ResultSet { ...@@ -879,302 +886,302 @@ public class RestfulResultSet implements ResultSet {
@Override @Override
public void updateRowId(int columnIndex, RowId x) throws SQLException { public void updateRowId(int columnIndex, RowId x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateRowId(String columnLabel, RowId x) throws SQLException { public void updateRowId(String columnLabel, RowId x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getHoldability() throws SQLException { public int getHoldability() throws SQLException {
// return 0; // return 0;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isClosed() throws SQLException { public boolean isClosed() throws SQLException {
return false; return false;
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
// throw new SQLFeatureNotSupportedException(); // throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNString(int columnIndex, String nString) throws SQLException { public void updateNString(int columnIndex, String nString) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNString(String columnLabel, String nString) throws SQLException { public void updateNString(String columnLabel, String nString) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(int columnIndex, NClob nClob) throws SQLException { public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(String columnLabel, NClob nClob) throws SQLException { public void updateNClob(String columnLabel, NClob nClob) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public NClob getNClob(int columnIndex) throws SQLException { public NClob getNClob(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public NClob getNClob(String columnLabel) throws SQLException { public NClob getNClob(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public SQLXML getSQLXML(int columnIndex) throws SQLException { public SQLXML getSQLXML(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public SQLXML getSQLXML(String columnLabel) throws SQLException { public SQLXML getSQLXML(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException { public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException { public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public String getNString(int columnIndex) throws SQLException { public String getNString(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public String getNString(String columnLabel) throws SQLException { public String getNString(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Reader getNCharacterStream(int columnIndex) throws SQLException { public Reader getNCharacterStream(int columnIndex) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public Reader getNCharacterStream(String columnLabel) throws SQLException { public Reader getNCharacterStream(String columnLabel) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException { public void updateNCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException { public void updateAsciiStream(int columnIndex, InputStream x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException { public void updateBinaryStream(int columnIndex, InputStream x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException { public void updateCharacterStream(int columnIndex, Reader x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException { public void updateAsciiStream(String columnLabel, InputStream x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException { public void updateBinaryStream(String columnLabel, InputStream x, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { public void updateClob(int columnIndex, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { public void updateClob(String columnLabel, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException { public void updateNCharacterStream(int columnIndex, Reader x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException { public void updateAsciiStream(int columnIndex, InputStream x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException { public void updateBinaryStream(int columnIndex, InputStream x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(int columnIndex, Reader x) throws SQLException { public void updateCharacterStream(int columnIndex, Reader x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException { public void updateAsciiStream(String columnLabel, InputStream x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException { public void updateBinaryStream(String columnLabel, InputStream x) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(int columnIndex, Reader reader) throws SQLException { public void updateClob(int columnIndex, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateClob(String columnLabel, Reader reader) throws SQLException { public void updateClob(String columnLabel, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(int columnIndex, Reader reader) throws SQLException { public void updateNClob(int columnIndex, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public void updateNClob(String columnLabel, Reader reader) throws SQLException { public void updateNClob(String columnLabel, Reader reader) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public <T> T getObject(int columnIndex, Class<T> type) throws SQLException { public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public <T> T getObject(String columnLabel, Class<T> type) throws SQLException { public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public <T> T unwrap(Class<T> iface) throws SQLException { public <T> T unwrap(Class<T> iface) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { public boolean isWrapperFor(Class<?> iface) throws SQLException {
//TODO: SQLFeature Not Supported //TODO: SQLFeature Not Supported
throw new SQLFeatureNotSupportedException(); throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
} }
package com.taosdata.jdbc.rs; package com.taosdata.jdbc.rs;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.taosdata.jdbc.TSDBConstants; import com.taosdata.jdbc.TSDBConstants;
import com.taosdata.jdbc.rs.util.HttpClientPoolUtil; import com.taosdata.jdbc.rs.util.HttpClientPoolUtil;
...@@ -12,12 +13,17 @@ import java.util.List; ...@@ -12,12 +13,17 @@ import java.util.List;
public class RestfulStatement implements Statement { public class RestfulStatement implements Statement {
private static final String STATEMENT_CLOSED = "Statement already closed.";
private boolean closed; private boolean closed;
private String database; private String database;
private final RestfulConnection conn; private final RestfulConnection conn;
public RestfulStatement(RestfulConnection c, String database) { private volatile RestfulResultSet resultSet;
this.conn = c; private volatile int affectedRows;
private volatile boolean closeOnCompletion;
public RestfulStatement(RestfulConnection conn, String database) {
this.conn = conn;
this.database = database; this.database = database;
} }
...@@ -45,9 +51,7 @@ public class RestfulStatement implements Statement { ...@@ -45,9 +51,7 @@ public class RestfulStatement implements Statement {
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getString("status").equals("error")) { if (jsonObject.getString("status").equals("error")) {
throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + jsonObject.getString("desc") + "\n" + "error code: " + jsonObject.getString("code")));
jsonObject.getString("desc") + "\n" +
"error code: " + jsonObject.getString("code")));
} }
String dataStr = jsonObject.getString("data"); String dataStr = jsonObject.getString("data");
if ("use".equalsIgnoreCase(fields.split(" ")[0])) { if ("use".equalsIgnoreCase(fields.split(" ")[0])) {
...@@ -59,13 +63,13 @@ public class RestfulStatement implements Statement { ...@@ -59,13 +63,13 @@ public class RestfulStatement implements Statement {
return new RestfulResultSet(dataStr, ""); return new RestfulResultSet(dataStr, "");
} }
if (jsonField.getString("status").equals("error")) { if (jsonField.getString("status").equals("error")) {
throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + jsonField.getString("desc") + "\n" + "error code: " + jsonField.getString("code")));
jsonField.getString("desc") + "\n" +
"error code: " + jsonField.getString("code")));
} }
String fieldData = jsonField.getString("data"); String fieldData = jsonField.getString("data");
return new RestfulResultSet(dataStr, fieldData); this.resultSet = new RestfulResultSet(dataStr, fieldData);
this.affectedRows = 0;
return resultSet;
} }
@Override @Override
...@@ -78,77 +82,103 @@ public class RestfulStatement implements Statement { ...@@ -78,77 +82,103 @@ public class RestfulStatement implements Statement {
if (this.database == null) if (this.database == null)
throw new SQLException("Database not specified or available"); throw new SQLException("Database not specified or available");
final String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql"; final String url = "http://" + conn.getHost().trim() + ":" + conn.getPort() + "/rest/sql";
HttpClientPoolUtil.execute(url, "use " + conn.getDatabase()); HttpClientPoolUtil.execute(url, "use " + conn.getDatabase());
String result = HttpClientPoolUtil.execute(url, sql); String result = HttpClientPoolUtil.execute(url, sql);
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getString("status").equals("error")) { if (jsonObject.getString("status").equals("error")) {
throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + jsonObject.getString("desc") + "\n" + "error code: " + jsonObject.getString("code")));
jsonObject.getString("desc") + "\n" +
"error code: " + jsonObject.getString("code")));
} }
return Integer.parseInt(jsonObject.getString("rows")); this.resultSet = null;
this.affectedRows = Integer.parseInt(jsonObject.getString("rows"));
return this.affectedRows;
} }
@Override @Override
public void close() throws SQLException { public void close() throws SQLException {
synchronized (RestfulStatement.class) {
if (!isClosed())
this.closed = true; this.closed = true;
} }
}
@Override @Override
public int getMaxFieldSize() throws SQLException { public int getMaxFieldSize() throws SQLException {
return 0; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return TSDBConstants.maxFieldSize;
} }
@Override @Override
public void setMaxFieldSize(int max) throws SQLException { public void setMaxFieldSize(int max) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
if (max < 0)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
// nothing to do
} }
@Override @Override
public int getMaxRows() throws SQLException { public int getMaxRows() throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return 0; return 0;
} }
@Override @Override
public void setMaxRows(int max) throws SQLException { public void setMaxRows(int max) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
if (max < 0)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
// nothing to do
} }
@Override @Override
public void setEscapeProcessing(boolean enable) throws SQLException { public void setEscapeProcessing(boolean enable) throws SQLException {
if (isClosed())
throw new SQLException(RestfulStatement.STATEMENT_CLOSED);
} }
@Override @Override
public int getQueryTimeout() throws SQLException { public int getQueryTimeout() throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return 0; return 0;
} }
@Override @Override
public void setQueryTimeout(int seconds) throws SQLException { public void setQueryTimeout(int seconds) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
if (seconds < 0)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
} }
@Override @Override
public void cancel() throws SQLException { public void cancel() throws SQLException {
throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public SQLWarning getWarnings() throws SQLException { public SQLWarning getWarnings() throws SQLException {
//TODO: getWarnings not Implemented if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return null; return null;
} }
@Override @Override
public void clearWarnings() throws SQLException { public void clearWarnings() throws SQLException {
// nothing to do
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
} }
@Override @Override
public void setCursorName(String name) throws SQLException { public void setCursorName(String name) throws SQLException {
if (isClosed())
throw new SQLException(RestfulStatement.STATEMENT_CLOSED);
throw new SQLException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
...@@ -163,129 +193,174 @@ public class RestfulStatement implements Statement { ...@@ -163,129 +193,174 @@ public class RestfulStatement implements Statement {
if (this.database == null) if (this.database == null)
throw new SQLException("Database not specified or available"); throw new SQLException("Database not specified or available");
if (SqlSyntaxValidator.isSelectSql(sql)) {
executeQuery(sql);
} else if (SqlSyntaxValidator.isInsertSql(sql)) {
executeUpdate(sql);
} else {
final String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql"; final String url = "http://" + conn.getHost() + ":" + conn.getPort() + "/rest/sql";
// use database HttpClientPoolUtil.execute(url, "use " + this.database);
HttpClientPoolUtil.execute(url, "use " + conn.getDatabase());
// execute sql
String result = HttpClientPoolUtil.execute(url, sql); String result = HttpClientPoolUtil.execute(url, sql);
// parse result
JSONObject jsonObject = JSON.parseObject(result); JSONObject jsonObject = JSON.parseObject(result);
if (jsonObject.getString("status").equals("error")) { if (jsonObject.getString("status").equals("error")) {
throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + throw new SQLException(TSDBConstants.WrapErrMsg("SQL execution error: " + jsonObject.getString("desc") + "\n" + "error code: " + jsonObject.getString("code")));
jsonObject.getString("desc") + "\n" +
"error code: " + jsonObject.getString("code")));
} }
this.resultSet = new RestfulResultSet(jsonObject.getJSONArray("data"), jsonObject.getJSONArray("head"));
}
return true; return true;
} }
@Override @Override
public ResultSet getResultSet() throws SQLException { public ResultSet getResultSet() throws SQLException {
return null; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return resultSet;
} }
@Override @Override
public int getUpdateCount() throws SQLException { public int getUpdateCount() throws SQLException {
return 0; if (isClosed()) {
throw new SQLException("Invalid method call on a closed statement.");
}
return this.affectedRows;
} }
@Override @Override
public boolean getMoreResults() throws SQLException { public boolean getMoreResults() throws SQLException {
return false; return getMoreResults(CLOSE_CURRENT_RESULT);
} }
@Override @Override
public void setFetchDirection(int direction) throws SQLException { public void setFetchDirection(int direction) throws SQLException {
if (direction != ResultSet.FETCH_FORWARD && direction != ResultSet.FETCH_REVERSE && direction != ResultSet.FETCH_UNKNOWN)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
this.resultSet.setFetchDirection(direction);
} }
@Override @Override
public int getFetchDirection() throws SQLException { public int getFetchDirection() throws SQLException {
return 0; return this.resultSet.getFetchDirection();
} }
@Override @Override
public void setFetchSize(int rows) throws SQLException { public void setFetchSize(int rows) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
if (rows < 0)
throw new SQLException(TSDBConstants.INVALID_VARIABLES);
//nothing to do
} }
@Override @Override
public int getFetchSize() throws SQLException { public int getFetchSize() throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return 0; return 0;
} }
@Override @Override
public int getResultSetConcurrency() throws SQLException { public int getResultSetConcurrency() throws SQLException {
return 0; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return this.resultSet.getConcurrency();
} }
@Override @Override
public int getResultSetType() throws SQLException { public int getResultSetType() throws SQLException {
return 0; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return this.resultSet.getType();
} }
@Override @Override
public void addBatch(String sql) throws SQLException { public void addBatch(String sql) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
//TODO:
} }
@Override @Override
public void clearBatch() throws SQLException { public void clearBatch() throws SQLException {
//TODO:
} }
@Override @Override
public int[] executeBatch() throws SQLException { public int[] executeBatch() throws SQLException {
//TODO:
return new int[0]; return new int[0];
} }
@Override @Override
public Connection getConnection() throws SQLException { public Connection getConnection() throws SQLException {
return null; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return this.conn;
} }
@Override @Override
public boolean getMoreResults(int current) throws SQLException { public boolean getMoreResults(int current) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
if (resultSet == null)
return false;
// switch (current) {
// case CLOSE_CURRENT_RESULT:
// resultSet.close();
// break;
// case KEEP_CURRENT_RESULT:
// break;
// case CLOSE_ALL_RESULTS:
// resultSet.close();
// break;
// default:
// throw new SQLException(TSDBConstants.INVALID_VARIABLES);
// }
// return next;
return false; return false;
} }
@Override @Override
public ResultSet getGeneratedKeys() throws SQLException { public ResultSet getGeneratedKeys() throws SQLException {
return null; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException { public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
return 0; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int executeUpdate(String sql, int[] columnIndexes) throws SQLException { public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
return 0; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int executeUpdate(String sql, String[] columnNames) throws SQLException { public int executeUpdate(String sql, String[] columnNames) throws SQLException {
return 0; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean execute(String sql, int autoGeneratedKeys) throws SQLException { public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
return false; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean execute(String sql, int[] columnIndexes) throws SQLException { public boolean execute(String sql, int[] columnIndexes) throws SQLException {
return false; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public boolean execute(String sql, String[] columnNames) throws SQLException { public boolean execute(String sql, String[] columnNames) throws SQLException {
return false; throw new SQLFeatureNotSupportedException(TSDBConstants.UNSUPPORT_METHOD_EXCEPTIONZ_MSG);
} }
@Override @Override
public int getResultSetHoldability() throws SQLException { public int getResultSetHoldability() throws SQLException {
return 0; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return this.resultSet.getHoldability();
} }
@Override @Override
...@@ -295,22 +370,30 @@ public class RestfulStatement implements Statement { ...@@ -295,22 +370,30 @@ public class RestfulStatement implements Statement {
@Override @Override
public void setPoolable(boolean poolable) throws SQLException { public void setPoolable(boolean poolable) throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
//nothing to do
} }
@Override @Override
public boolean isPoolable() throws SQLException { public boolean isPoolable() throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return false; return false;
} }
@Override @Override
public void closeOnCompletion() throws SQLException { public void closeOnCompletion() throws SQLException {
if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
this.closeOnCompletion = true;
} }
@Override @Override
public boolean isCloseOnCompletion() throws SQLException { public boolean isCloseOnCompletion() throws SQLException {
return false; if (isClosed())
throw new SQLException(STATEMENT_CLOSED);
return this.closeOnCompletion;
} }
@Override @Override
......
...@@ -31,8 +31,8 @@ public class SqlSyntaxValidator { ...@@ -31,8 +31,8 @@ public class SqlSyntaxValidator {
this.tsdbConnection = (TSDBConnection) connection; this.tsdbConnection = (TSDBConnection) connection;
} }
/*
public boolean validateSqlSyntax(String sql) throws SQLException { public boolean validateSqlSyntax(String sql) throws SQLException {
boolean res = false; boolean res = false;
if (tsdbConnection == null || tsdbConnection.isClosed()) { if (tsdbConnection == null || tsdbConnection.isClosed()) {
throw new SQLException("invalid connection"); throw new SQLException("invalid connection");
...@@ -46,6 +46,7 @@ public class SqlSyntaxValidator { ...@@ -46,6 +46,7 @@ public class SqlSyntaxValidator {
} }
return res; return res;
} }
*/
public static boolean isValidForExecuteUpdate(String sql) { public static boolean isValidForExecuteUpdate(String sql) {
for (String prefix : updateSQL) { for (String prefix : updateSQL) {
......
package com.taosdata.jdbc.rs; package com.taosdata.jdbc.rs;
import org.junit.*; import org.junit.*;
import org.junit.runners.MethodSorters; import org.junit.runners.MethodSorters;
......
package com.taosdata.jdbc.rs;
import org.junit.*;
import org.junit.runners.MethodSorters;
import java.sql.*;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class SQLTest {
private static final String host = "master";
private static Connection connection;
@Test
public void testCase001() {
String sql = "create database if not exists restful_test";
execute(sql);
}
@Test
public void testCase002() {
String sql = "use restful_test";
execute(sql);
}
@Test
public void testCase003() {
String sql = "show databases";
try (Statement statement = connection.createStatement()) {
statement.execute(sql);
ResultSet resultSet = statement.getResultSet();
printResult(resultSet);
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test
public void testCase004() {
String sql = "select * from restful_test.weather";
executeQuery(sql);
}
private void execute(String sql) {
try (Statement statement = connection.createStatement()) {
long start = System.currentTimeMillis();
boolean execute = statement.execute(sql);
long end = System.currentTimeMillis();
printSql(sql, execute, (end - start));
} catch (SQLException e) {
System.out.println("ERROR execute SQL ===> " + sql);
e.printStackTrace();
}
}
private static void printSql(String sql, boolean succeed, long cost) {
System.out.println("[ " + (succeed ? "OK" : "ERROR!") + " ] time cost: " + cost + " ms, execute statement ====> " + sql);
}
private void executeQuery(String sql) {
try (Statement statement = connection.createStatement()) {
long start = System.currentTimeMillis();
ResultSet resultSet = statement.executeQuery(sql);
long end = System.currentTimeMillis();
printSql(sql, true, (end - start));
printResult(resultSet);
} catch (SQLException e) {
System.out.println("ERROR execute SQL ===> " + sql);
e.printStackTrace();
}
}
private static void printResult(ResultSet resultSet) throws SQLException {
ResultSetMetaData metaData = resultSet.getMetaData();
while (resultSet.next()) {
StringBuilder sb = new StringBuilder();
for (int i = 1; i <= metaData.getColumnCount(); i++) {
String columnLabel = metaData.getColumnLabel(i);
String value = resultSet.getString(i);
sb.append(columnLabel + ": " + value + "\t");
}
System.out.println(sb.toString());
}
}
@BeforeClass
public static void before() throws ClassNotFoundException, SQLException {
Class.forName("com.taosdata.jdbc.rs.RestfulDriver");
connection = DriverManager.getConnection("jdbc:TAOS-RS://" + host + ":6041/restful_test?user=root&password=taosdata");
}
@AfterClass
public static void after() throws SQLException {
connection.close();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册