content: /*
   * Copyright 2021 4Paradigm
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  
  package com._4paradigm.openmldb.jdbc;
  
  import com._4paradigm.openmldb.*;
  
  import java.io.InputStream;
  import java.io.Reader;
  import java.math.BigDecimal;
  import java.net.URL;
  import java.sql.Date;
  import java.sql.ResultSet;
  import java.sql.*;
  import java.util.*;
  
  public abstract class PreparedStatement implements java.sql.PreparedStatement {
      protected SQLRouter router;
      protected boolean closed = false;
      protected boolean closeOnComplete = false;
  
  
      protected void checkClosed() throws SQLException {
          if (closed) {
              throw new SQLException("PreparedStatement closed");
          }
      }
  
      protected void checkExecutorClosed() throws SQLException {
          if (router == null) {
              throw new SQLException("Executor close");
          }
      }
  
      @Override
      @Deprecated
      public int executeUpdate() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setByte(int i, byte b) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBigDecimal(int i, BigDecimal bigDecimal) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
  
      @Override
      @Deprecated
      public void setBytes(int i, byte[] bytes) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
      @Override
      @Deprecated
      public void setTime(int i, Time time) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
      @Override
      @Deprecated
      public void setAsciiStream(int i, InputStream inputStream, int i1) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
      @Override
      @Deprecated
      public void setUnicodeStream(int i, InputStream inputStream, int i1) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
      @Override
      @Deprecated
      public void setBinaryStream(int i, InputStream inputStream, int i1) throws SQLException {
          throw new SQLException("current do not support this type");
      }
  
      @Override
      @Deprecated
      public void setObject(int i, Object o, int i1) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
  
      @Override
      @Deprecated
      public void setObject(int i, Object o) throws SQLException {
          throw new SQLException("current do not support this m¡ethod");
      }
  
      @Override
      @Deprecated
      public boolean execute() throws SQLException {
  
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void addBatch() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setCharacterStream(int i, Reader reader, int i1) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setRef(int i, Ref ref) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBlob(int i, Blob blob) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setClob(int i, Clob clob) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setArray(int i, Array array) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setDate(int i, Date date, Calendar calendar) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setTime(int i, Time time, Calendar calendar) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setTimestamp(int i, Timestamp timestamp, Calendar calendar) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNull(int i, int i1, String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setURL(int i, URL url) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public ParameterMetaData getParameterMetaData() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setRowId(int i, RowId rowId) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNString(int i, String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNCharacterStream(int i, Reader reader, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNClob(int i, NClob nClob) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setClob(int i, Reader reader, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBlob(int i, InputStream inputStream, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNClob(int i, Reader reader, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setSQLXML(int i, SQLXML sqlxml) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setObject(int i, Object o, int i1, int i2) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setAsciiStream(int i, InputStream inputStream, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBinaryStream(int i, InputStream inputStream, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setCharacterStream(int i, Reader reader, long l) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setAsciiStream(int i, InputStream inputStream) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBinaryStream(int i, InputStream inputStream) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setCharacterStream(int i, Reader reader) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNCharacterStream(int i, Reader reader) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setClob(int i, Reader reader) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setBlob(int i, InputStream inputStream) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setNClob(int i, Reader reader) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public ResultSet executeQuery(String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int executeUpdate(String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void close() throws SQLException {
          this.router = null;
          this.closed = true;
      }
  
      @Override
      @Deprecated
      public int getMaxFieldSize() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setMaxFieldSize(int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getMaxRows() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setMaxRows(int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setEscapeProcessing(boolean b) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getQueryTimeout() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setQueryTimeout(int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void cancel() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public SQLWarning getWarnings() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void clearWarnings() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setCursorName(String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean execute(String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public ResultSet getResultSet() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getUpdateCount() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean getMoreResults() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public void setFetchDirection(int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Deprecated
      @Override
      public int getFetchDirection() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void setFetchSize(int i) throws SQLException {
          // ResultSet we got is full, this config is unused. But do not throw exception.
      }
  
      @Override
      @Deprecated
      public int getFetchSize() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getResultSetConcurrency() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getResultSetType() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void addBatch(String s) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void clearBatch() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public int[] executeBatch() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public Connection getConnection() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean getMoreResults(int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public ResultSet getGeneratedKeys() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int executeUpdate(String s, int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int executeUpdate(String s, int[] ints) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int executeUpdate(String s, String[] strings) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean execute(String s, int i) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean execute(String s, int[] ints) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean execute(String s, String[] strings) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public int getResultSetHoldability() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public boolean isClosed() throws SQLException {
          return closed;
      }
  
      @Override
      @Deprecated
      public void setPoolable(boolean b) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean isPoolable() throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      public void closeOnCompletion() throws SQLException {
          this.closeOnComplete = true;
      }
  
      @Override
      public boolean isCloseOnCompletion() throws SQLException {
          return this.closeOnComplete;
      }
  
      @Override
      @Deprecated
      public <T> T unwrap(Class<T> aClass) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  
      @Override
      @Deprecated
      public boolean isWrapperFor(Class<?> aClass) throws SQLException {
          throw new SQLException("current do not support this method");
      }
  }
  
  