Path: blob/master/test/jdk/java/sql/testng/util/StubConnection.java
41152 views
/*1* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/22package util;2324import java.sql.Array;25import java.sql.Blob;26import java.sql.CallableStatement;27import java.sql.Clob;28import java.sql.Connection;29import java.sql.DatabaseMetaData;30import java.sql.NClob;31import java.sql.PreparedStatement;32import java.sql.SQLClientInfoException;33import java.sql.SQLException;34import java.sql.SQLWarning;35import java.sql.SQLXML;36import java.sql.Savepoint;37import java.sql.Statement;38import java.sql.Struct;39import java.util.Map;40import java.util.Properties;41import java.util.concurrent.Executor;4243public class StubConnection implements Connection {4445private boolean autoCommit = false;4647@Override48public Statement createStatement() throws SQLException {49throw new UnsupportedOperationException("Not supported yet.");50}5152@Override53public PreparedStatement prepareStatement(String sql) throws SQLException {54throw new UnsupportedOperationException("Not supported yet.");55}5657@Override58public CallableStatement prepareCall(String sql) throws SQLException {59throw new UnsupportedOperationException("Not supported yet.");60}6162@Override63public String nativeSQL(String sql) throws SQLException {64throw new UnsupportedOperationException("Not supported yet.");65}6667@Override68public void setAutoCommit(boolean autoCommit) throws SQLException {69System.out.println("**** in StubConnection.setAutoCommit");70this.autoCommit = autoCommit;71}7273@Override74public boolean getAutoCommit() throws SQLException {75System.out.println("*** in StubConnection.getAutoCommit");76return autoCommit;77}7879@Override80public void commit() throws SQLException {81throw new UnsupportedOperationException("Not supported yet.");82}8384@Override85public void rollback() throws SQLException {86throw new UnsupportedOperationException("Not supported yet.");87}8889@Override90public void close() throws SQLException {91throw new UnsupportedOperationException("Not supported yet.");92}9394@Override95public boolean isClosed() throws SQLException {96throw new UnsupportedOperationException("Not supported yet.");97}9899@Override100public DatabaseMetaData getMetaData() throws SQLException {101throw new UnsupportedOperationException("Not supported yet.");102}103104@Override105public void setReadOnly(boolean readOnly) throws SQLException {106throw new UnsupportedOperationException("Not supported yet.");107}108109@Override110public boolean isReadOnly() throws SQLException {111throw new UnsupportedOperationException("Not supported yet.");112}113114@Override115public void setCatalog(String catalog) throws SQLException {116throw new UnsupportedOperationException("Not supported yet.");117}118119@Override120public String getCatalog() throws SQLException {121throw new UnsupportedOperationException("Not supported yet.");122}123124@Override125public void setTransactionIsolation(int level) throws SQLException {126throw new UnsupportedOperationException("Not supported yet.");127}128129@Override130public int getTransactionIsolation() throws SQLException {131throw new UnsupportedOperationException("Not supported yet.");132}133134@Override135public SQLWarning getWarnings() throws SQLException {136throw new UnsupportedOperationException("Not supported yet.");137}138139@Override140public void clearWarnings() throws SQLException {141throw new UnsupportedOperationException("Not supported yet.");142}143144@Override145public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {146throw new UnsupportedOperationException("Not supported yet.");147}148149@Override150public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {151throw new UnsupportedOperationException("Not supported yet.");152}153154@Override155public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {156throw new UnsupportedOperationException("Not supported yet.");157}158159@Override160public Map<String, Class<?>> getTypeMap() throws SQLException {161throw new UnsupportedOperationException("Not supported yet.");162}163164@Override165public void setTypeMap(Map<String, Class<?>> map) throws SQLException {166throw new UnsupportedOperationException("Not supported yet.");167}168169@Override170public void setHoldability(int holdability) throws SQLException {171throw new UnsupportedOperationException("Not supported yet.");172}173174@Override175public int getHoldability() throws SQLException {176throw new UnsupportedOperationException("Not supported yet.");177}178179@Override180public Savepoint setSavepoint() throws SQLException {181throw new UnsupportedOperationException("Not supported yet.");182}183184@Override185public Savepoint setSavepoint(String name) throws SQLException {186throw new UnsupportedOperationException("Not supported yet.");187}188189@Override190public void rollback(Savepoint savepoint) throws SQLException {191throw new UnsupportedOperationException("Not supported yet.");192}193194@Override195public void releaseSavepoint(Savepoint savepoint) throws SQLException {196throw new UnsupportedOperationException("Not supported yet.");197}198199@Override200public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {201throw new UnsupportedOperationException("Not supported yet.");202}203204@Override205public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {206throw new UnsupportedOperationException("Not supported yet.");207}208209@Override210public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {211throw new UnsupportedOperationException("Not supported yet.");212}213214@Override215public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {216throw new UnsupportedOperationException("Not supported yet.");217}218219@Override220public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {221throw new UnsupportedOperationException("Not supported yet.");222}223224@Override225public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {226throw new UnsupportedOperationException("Not supported yet.");227}228229@Override230public Clob createClob() throws SQLException {231throw new UnsupportedOperationException("Not supported yet.");232}233234@Override235public Blob createBlob() throws SQLException {236throw new UnsupportedOperationException("Not supported yet.");237}238239@Override240public NClob createNClob() throws SQLException {241throw new UnsupportedOperationException("Not supported yet.");242}243244@Override245public SQLXML createSQLXML() throws SQLException {246throw new UnsupportedOperationException("Not supported yet.");247}248249@Override250public boolean isValid(int timeout) throws SQLException {251throw new UnsupportedOperationException("Not supported yet.");252}253254@Override255public void setClientInfo(String name, String value) throws SQLClientInfoException {256throw new UnsupportedOperationException("Not supported yet.");257}258259@Override260public void setClientInfo(Properties properties) throws SQLClientInfoException {261throw new UnsupportedOperationException("Not supported yet.");262}263264@Override265public String getClientInfo(String name) throws SQLException {266throw new UnsupportedOperationException("Not supported yet.");267}268269@Override270public Properties getClientInfo() throws SQLException {271throw new UnsupportedOperationException("Not supported yet.");272}273274@Override275public Array createArrayOf(String typeName, Object[] elements) throws SQLException {276throw new UnsupportedOperationException("Not supported yet.");277}278279@Override280public Struct createStruct(String typeName, Object[] attributes) throws SQLException {281throw new UnsupportedOperationException("Not supported yet.");282}283284@Override285public void setSchema(String schema) throws SQLException {286throw new UnsupportedOperationException("Not supported yet.");287}288289@Override290public String getSchema() throws SQLException {291throw new UnsupportedOperationException("Not supported yet.");292}293294@Override295public void abort(Executor executor) throws SQLException {296throw new UnsupportedOperationException("Not supported yet.");297}298299@Override300public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {301throw new UnsupportedOperationException("Not supported yet.");302}303304@Override305public int getNetworkTimeout() throws SQLException {306throw new UnsupportedOperationException("Not supported yet.");307}308309@Override310public <T> T unwrap(Class<T> iface) throws SQLException {311throw new UnsupportedOperationException("Not supported yet.");312}313314@Override315public boolean isWrapperFor(Class<?> iface) throws SQLException {316throw new UnsupportedOperationException("Not supported yet.");317}318}319320321