@Override public void setAutoCommit(boolean isAutoCommit) throws SQLException { checkOpen(); this.isAutoCommit = isAutoCommit; }
@Override public void setSchema(String schema) throws SQLException { checkOpen(); this.schema = schema; }
@Override public void setReadOnly(boolean readOnly) throws SQLException { checkOpen(); this.readOnly = readOnly; }
@Override public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { checkOpen(); }
@Override public void abort(Executor executor) throws SQLException { checkOpen(); }
@Override public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { checkOpen(); // Ignore autoGeneratedKeys, and just execute the statement. return prepareStatement(sql); }
@Override public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { checkOpen(); if (resultSetType != ResultSet.TYPE_FORWARD_ONLY || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { throw new SQLFeatureNotSupportedException(); } return createStatement(); }
@Override public DatabaseMetaData getMetaData() throws SQLException { checkOpen(); return new PhoenixDatabaseMetaData(this); }
@Override public PreparedStatement prepareStatement(String sql) throws SQLException { checkOpen(); PhoenixPreparedStatement statement = new PhoenixPreparedStatement(this, sql); statements.add(statement); return statement; }
@Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { checkOpen(); if (resultSetType != ResultSet.TYPE_FORWARD_ONLY || resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { throw new SQLFeatureNotSupportedException(); } return prepareStatement(sql); }
@Override public Statement createStatement() throws SQLException { checkOpen(); PhoenixStatement statement = new PhoenixStatement(this); statements.add(statement); return statement; }
@Override public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkOpen(); if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { throw new SQLFeatureNotSupportedException(); } return createStatement(resultSetType, resultSetConcurrency); }
@Override public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { checkOpen(); // Ignore columnIndexes, and just execute the statement. return prepareStatement(sql); }
@Override public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { checkOpen(); // Ignore columnNames, and just execute the statement. return prepareStatement(sql); }
@Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { checkOpen(); if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { throw new SQLFeatureNotSupportedException(); } return prepareStatement(sql, resultSetType, resultSetConcurrency); }
@Override public void setCatalog(String catalog) throws SQLException { checkOpen(); if (!this.getCatalog().equalsIgnoreCase(catalog)) { // allow noop calls to pass through. throw new SQLFeatureNotSupportedException(); } // TODO: // if (catalog == null) { // tenantId = null; // } else { // tenantId = PNameFactory.newName(catalog); // } }
@Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { checkOpen(); PDataType arrayPrimitiveType = PDataType.fromSqlTypeName(typeName); return PArrayDataType.instantiatePhoenixArray(arrayPrimitiveType, elements); }
@Override public void setTransactionIsolation(int level) throws SQLException { checkOpen(); boolean transactionsEnabled = getQueryServices().getProps().getBoolean( QueryServices.TRANSACTIONS_ENABLED, QueryServicesOptions.DEFAULT_TRANSACTIONS_ENABLED); if (level == Connection.TRANSACTION_SERIALIZABLE) { throw new SQLFeatureNotSupportedException(); } if (!transactionsEnabled && level == Connection.TRANSACTION_REPEATABLE_READ) { throw new SQLExceptionInfo.Builder( SQLExceptionCode.TX_MUST_BE_ENABLED_TO_SET_ISOLATION_LEVEL) .build().buildException(); } }
@Override public PreparedStatement prepareStatement(String sql) throws SQLException { checkOpen(); PhoenixPreparedStatement statement = new PhoenixPreparedStatement(this, sql); statements.add(statement); return statement; }
@Override public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { checkOpen(); // Ignore columnIndexes, and just execute the statement. return prepareStatement(sql); }