/* * Copyright 2007-2010 Brian S O'Neill * * 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 org.cojen.dirmi.jdbc; import java.rmi.Remote; import java.rmi.RemoteException; import java.sql.SQLClientInfoException; import java.sql.SQLException; import java.sql.SQLWarning; import java.util.Properties; import org.cojen.dirmi.Batched; import org.cojen.dirmi.RemoteFailure; /** * * * @author Brian S O'Neill */ @RemoteFailure(exception=SQLException.class) public interface RemoteConnection extends Remote { @Batched RemoteStatement createStatement() throws SQLException; @Batched RemoteStatement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException; @Batched RemoteStatement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException; @Batched RemotePreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException; /* FIXME @Batched RemoteCallableStatement prepareCall(String sql) throws SQLException; @Batched RemoteCallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException; @Batched RemoteCallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException; */ String nativeSQL(String sql) throws SQLException; @Batched void setAutoCommit(boolean autoCommit) throws SQLException; boolean getAutoCommit() throws SQLException; void commit() throws SQLException; void rollback() throws SQLException; void close() throws SQLException; boolean isClosed() throws SQLException; @Batched RemoteDatabaseMetaData getMetaData() throws SQLException; @Batched void setReadOnly(boolean readOnly) throws SQLException; boolean isReadOnly() throws SQLException; @Batched void setCatalog(String catalog) throws SQLException; String getCatalog() throws SQLException; @Batched void setTransactionIsolation(int level) throws SQLException; int getTransactionIsolation() throws SQLException; SQLWarning getWarnings() throws SQLException; @Batched void clearWarnings() throws SQLException; java.util.Map<String,Class<?>> getTypeMap() throws SQLException; @Batched void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException; @Batched void setHoldability(int holdability) throws SQLException; int getHoldability() throws SQLException; /* FIXME @Batched Savepoint setSavepoint() throws SQLException; @Batched Savepoint setSavepoint(String name) throws SQLException; void rollback(Savepoint savepoint) throws SQLException; void releaseSavepoint(Savepoint savepoint) throws SQLException; */ /* FIXME Clob createClob() throws SQLException; Blob createBlob() throws SQLException; */ boolean isValid(int timeout) throws SQLException; @Batched @RemoteFailure(exception=RemoteException.class) void setClientInfo(String name, String value) throws RemoteException, SQLClientInfoException; @Batched @RemoteFailure(exception=RemoteException.class) void setClientInfo(Properties properties) throws RemoteException, SQLClientInfoException; String getClientInfo(String name) throws SQLException; Properties getClientInfo() throws SQLException; }