com.pivotal.gemfirexd.internal.client.am.PreparedStatement40 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snappydata-store-client Show documentation
Show all versions of snappydata-store-client Show documentation
SnappyData store based off Pivotal GemFireXD
The newest version!
/*
Derby - Class com.pivotal.gemfirexd.internal.client.am.PreparedStatement40
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
*/
/*
* Changes for GemFireXD distributed data platform (some marked by "GemStone changes")
*
* Portions Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
*
* 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. See accompanying
* LICENSE file.
*/
package com.pivotal.gemfirexd.internal.client.am;
import java.sql.RowId;
import java.sql.NClob;
import java.sql.SQLException;
import java.sql.SQLXML;
import java.io.Reader;
import java.io.InputStream;
import com.pivotal.gemfirexd.internal.client.ClientPooledConnection;
import com.pivotal.gemfirexd.internal.client.am.SqlException;
import com.pivotal.gemfirexd.internal.client.am.ClientMessageId;
import com.pivotal.gemfirexd.internal.shared.common.reference.SQLState;
// Gemstone changes BEGIN
//public class PreparedStatement40 extends com.pivotal.gemfirexd.internal.client.am.PreparedStatement{
public class PreparedStatement40 extends com.pivotal.gemfirexd.internal.client.am.SingleHopPreparedStatement{
//Gemstone changes END
/**
* The PreparedStatement used for JDBC 4 positioned update statements.
* Called by material statement constructors.
* It has the ClientPooledConnection as one of its parameters
* this is used to raise the Statement Events when the prepared
* statement is closed
*
* @param agent The instance of NetAgent associated with this
* CallableStatement object.
* @param connection The connection object associated with this
* PreparedStatement Object.
* @param sql A String object that is the SQL statement to be sent
* to the database.
* @param section Section
* @param cpc The ClientPooledConnection wraps the underlying physical
* connection associated with this prepared statement.
* It is used to pass the Statement closed and the Statement
* error occurred events that occur back to the
* ClientPooledConnection.
* @throws SqlException
*/
public PreparedStatement40(Agent agent,
Connection connection,
String sql,
Section section,ClientPooledConnection cpc) throws SqlException {
super(agent, connection,sql,section,cpc);
}
/**
* The PreparedStatementConstructor used for jdbc 4 prepared statements
* with scroll attributes. Called by material statement constructors.
* It has the ClientPooledConnection as one of its parameters
* this is used to raise the Statement Events when the prepared
* statement is closed
*
* @param agent The instance of NetAgent associated with this
* CallableStatement object.
* @param connection The connection object associated with this
* PreparedStatement Object.
* @param sql A String object that is the SQL statement
* to be sent to the database.
* @param type One of the ResultSet type constants.
* @param concurrency One of the ResultSet concurrency constants.
* @param holdability One of the ResultSet holdability constants.
* @param autoGeneratedKeys a flag indicating whether auto-generated
* keys should be returned.
* @param columnNames an array of column names indicating the columns that
* should be returned from the inserted row or rows.
* @param columnIndexes an array of column indexes indicating the columns
* that should be returned from the inserted row.
* @param cpc The ClientPooledConnection wraps the underlying physical
* connection associated with this prepared statement
* it is used to pass the Statement closed and the Statement
* error occurred events that occur back to the
* ClientPooledConnection.
* @throws SqlException
*/
public PreparedStatement40(Agent agent,
Connection connection,
String sql,
int type, int concurrency, int holdability, int autoGeneratedKeys,
String[] columnNames, int[] columnIndexes, ClientPooledConnection cpc) throws SqlException {
super(agent, connection, sql, type, concurrency, holdability, autoGeneratedKeys,
columnNames, columnIndexes, cpc);
}
public void setRowId(int parameterIndex, RowId x) throws SQLException{
throw SQLExceptionFactory.notImplemented ("setRowId (int, RowId)");
}
public void setNString(int index, String value) throws SQLException{
throw SQLExceptionFactory.notImplemented ("setNString (int, String)");
}
public void setNCharacterStream(int parameterIndex, Reader value)
throws SQLException {
throw SQLExceptionFactory.notImplemented("setNCharacterStream" +
"(int,Reader)");
}
public void setNCharacterStream(int index, Reader value, long length)
throws SQLException{
throw SQLExceptionFactory.notImplemented ("setNCharacterStream " +
"(int,Reader,long)");
}
public void setNClob(int parameterIndex, Reader reader)
throws SQLException {
throw SQLExceptionFactory.notImplemented("setNClob(int,Reader)");
}
public void setNClob(int index, NClob value) throws SQLException{
throw SQLExceptionFactory.notImplemented ("setNClob (int, NClob)");
}
public void setNClob(int parameterIndex, Reader reader, long length)
throws SQLException{
throw SQLExceptionFactory.notImplemented ("setNClob (int, Reader, long)");
}
public void setSQLXML(int parameterIndex, SQLXML xmlObject)
throws SQLException{
throw SQLExceptionFactory.notImplemented ("setSQLXML (int, SQLXML)");
}
/**
* Returns this
if this class implements the interface
*
* @param interfaces a Class defining an interface
* @return an object that implements the interface
* @throws java.sql.SQLExption if no object if found that implements the
* interface
*/
public T unwrap(java.lang.Class interfaces)
throws SQLException {
try {
checkForClosedStatement();
return interfaces.cast(this);
} catch (ClassCastException cce) {
throw new SqlException(null,new ClientMessageId(SQLState.UNABLE_TO_UNWRAP),
interfaces).getSQLException(agent_ /* GemStoneAddition */);
} catch (SqlException se) {
throw se.getSQLException(agent_ /* GemStoneAddition */);
}
}
public void closeOnCompletion() throws SQLException {
// TODO Auto-generated method stub
}
public boolean isCloseOnCompletion() throws SQLException {
// TODO Auto-generated method stub
return false;
}
}