org.seasar.framework.mock.sql
クラス MockConnection

java.lang.Object
  拡張org.seasar.framework.mock.sql.MockConnection
すべての実装インタフェース:
Connection

public class MockConnection
extends Object
implements Connection

Connection用のモッククラスです。

作成者:
higa

フィールドの概要
 
インタフェース java.sql.Connection から継承したフィールド
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
 
コンストラクタの概要
MockConnection()
           
 
メソッドの概要
 void clearWarnings()
           
 void close()
           
 void commit()
           
 MockStatement createMockStatement()
          モック用のステートメントを作成します。
 MockStatement createMockStatement(int resultSetType, int resultSetConcurrency)
          モック用のステートメントを作成します。
 MockStatement createMockStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          モック用のステートメントを作成します。
 Statement createStatement()
           
 Statement createStatement(int resultSetType, int resultSetConcurrency)
           
 Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 boolean getAutoCommit()
           
 String getCatalog()
           
 int getHoldability()
           
 DatabaseMetaData getMetaData()
           
 int getTransactionIsolation()
           
 Map getTypeMap()
           
 SQLWarning getWarnings()
           
 boolean isClosed()
           
 boolean isCommitted()
          コミットしているかどうかを返します。
 boolean isReadOnly()
           
 boolean isRolledback()
          ロールバックしたかどうかを返します。
 String nativeSQL(String sql)
           
 CallableStatement prepareCall(String sql)
           
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
           
 CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 MockCallableStatement prepareMockCall(String sql)
          モック用の呼び出し可能なステートメントを作成します。
 MockCallableStatement prepareMockCall(String sql, int resultSetType, int resultSetConcurrency)
          モック用の呼び出し可能なステートメントを作成します。
 MockCallableStatement prepareMockCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          モック用の呼び出し可能なステートメントを作成します。
 MockPreparedStatement prepareMockStatement(String sql)
          モック用の準備されたステートメントを返します。
 MockPreparedStatement prepareMockStatement(String sql, int autoGeneratedKeys)
          モック用の準備されたステートメントを返します。
 MockPreparedStatement prepareMockStatement(String sql, int[] columnIndices)
          モック用の準備されたステートメントを返します。
 MockPreparedStatement prepareMockStatement(String sql, int resultSetType, int resultSetConcurrency)
          モック用の準備されたステートメントを作成します。
 MockPreparedStatement prepareMockStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
          モック用の準備されたステートメントを作成します。
 MockPreparedStatement prepareMockStatement(String sql, String[] columnNames)
          モック用の準備されたステートメントを返します。
 PreparedStatement prepareStatement(String sql)
           
 PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
           
 PreparedStatement prepareStatement(String sql, int[] columnIndices)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
           
 PreparedStatement prepareStatement(String sql, String[] columnNames)
           
 void releaseSavepoint(Savepoint savepoint)
           
 void rollback()
           
 void rollback(Savepoint savepoint)
           
 void setAutoCommit(boolean autoCommit)
           
 void setCatalog(String catalog)
           
 void setClosed(boolean closed)
          閉じているかどうかを設定します。
 void setCommitted(boolean committed)
          コミットしているかどうかを設定します。
 void setHoldability(int holdability)
           
 void setReadOnly(boolean readOnly)
           
 void setRolledback(boolean rolledback)
          ロールバックしたかどうかを設定します。
 Savepoint setSavepoint()
           
 Savepoint setSavepoint(String name)
           
 void setTransactionIsolation(int level)
           
 void setTypeMap(Map arg0)
           
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

MockConnection

public MockConnection()
メソッドの詳細

clearWarnings

public void clearWarnings()
                   throws SQLException
定義:
インタフェース Connection 内の clearWarnings
例外:
SQLException

close

public void close()
           throws SQLException
定義:
インタフェース Connection 内の close
例外:
SQLException

commit

public void commit()
            throws SQLException
定義:
インタフェース Connection 内の commit
例外:
SQLException

isCommitted

public boolean isCommitted()
コミットしているかどうかを返します。

戻り値:
コミットしているかどうか

setCommitted

public void setCommitted(boolean committed)
コミットしているかどうかを設定します。

パラメータ:
committed - コミットしているかどうか

createStatement

public Statement createStatement()
                          throws SQLException
定義:
インタフェース Connection 内の createStatement
例外:
SQLException

createMockStatement

public MockStatement createMockStatement()
モック用のステートメントを作成します。

戻り値:
モック用のステートメント

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency,
                                 int resultSetHoldability)
                          throws SQLException
定義:
インタフェース Connection 内の createStatement
例外:
SQLException

createMockStatement

public MockStatement createMockStatement(int resultSetType,
                                         int resultSetConcurrency,
                                         int resultSetHoldability)
モック用のステートメントを作成します。

パラメータ:
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
resultSetHoldability - 結果セット保持力
戻り値:
モック用のステートメント

createStatement

public Statement createStatement(int resultSetType,
                                 int resultSetConcurrency)
                          throws SQLException
定義:
インタフェース Connection 内の createStatement
例外:
SQLException

createMockStatement

public MockStatement createMockStatement(int resultSetType,
                                         int resultSetConcurrency)
モック用のステートメントを作成します。

パラメータ:
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
戻り値:
モック用のステートメント

getAutoCommit

public boolean getAutoCommit()
                      throws SQLException
定義:
インタフェース Connection 内の getAutoCommit
例外:
SQLException

getCatalog

public String getCatalog()
                  throws SQLException
定義:
インタフェース Connection 内の getCatalog
例外:
SQLException

getHoldability

public int getHoldability()
                   throws SQLException
定義:
インタフェース Connection 内の getHoldability
例外:
SQLException

getMetaData

public DatabaseMetaData getMetaData()
                             throws SQLException
定義:
インタフェース Connection 内の getMetaData
例外:
SQLException

getTransactionIsolation

public int getTransactionIsolation()
                            throws SQLException
定義:
インタフェース Connection 内の getTransactionIsolation
例外:
SQLException

getTypeMap

public Map getTypeMap()
               throws SQLException
定義:
インタフェース Connection 内の getTypeMap
例外:
SQLException

getWarnings

public SQLWarning getWarnings()
                       throws SQLException
定義:
インタフェース Connection 内の getWarnings
例外:
SQLException

isClosed

public boolean isClosed()
                 throws SQLException
定義:
インタフェース Connection 内の isClosed
例外:
SQLException

setClosed

public void setClosed(boolean closed)
閉じているかどうかを設定します。

パラメータ:
closed - 閉じているかどうか

isReadOnly

public boolean isReadOnly()
                   throws SQLException
定義:
インタフェース Connection 内の isReadOnly
例外:
SQLException

nativeSQL

public String nativeSQL(String sql)
                 throws SQLException
定義:
インタフェース Connection 内の nativeSQL
例外:
SQLException

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
                              throws SQLException
定義:
インタフェース Connection 内の prepareCall
例外:
SQLException

prepareMockCall

public MockCallableStatement prepareMockCall(String sql,
                                             int resultSetType,
                                             int resultSetConcurrency,
                                             int resultSetHoldability)
モック用の呼び出し可能なステートメントを作成します。

パラメータ:
sql - SQL
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
resultSetHoldability - 結果セット保持力
戻り値:
モック用の呼び出し可能なステートメント

prepareCall

public CallableStatement prepareCall(String sql,
                                     int resultSetType,
                                     int resultSetConcurrency)
                              throws SQLException
定義:
インタフェース Connection 内の prepareCall
例外:
SQLException

prepareMockCall

public MockCallableStatement prepareMockCall(String sql,
                                             int resultSetType,
                                             int resultSetConcurrency)
モック用の呼び出し可能なステートメントを作成します。

パラメータ:
sql - SQL
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
戻り値:
モック用の呼び出し可能なステートメント

prepareCall

public CallableStatement prepareCall(String sql)
                              throws SQLException
定義:
インタフェース Connection 内の prepareCall
例外:
SQLException

prepareMockCall

public MockCallableStatement prepareMockCall(String sql)
モック用の呼び出し可能なステートメントを作成します。

パラメータ:
sql - SQL
戻り値:
モック用の呼び出し可能なステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency,
                                          int resultSetHoldability)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql,
                                                  int resultSetType,
                                                  int resultSetConcurrency,
                                                  int resultSetHoldability)
モック用の準備されたステートメントを作成します。

パラメータ:
sql - SQL
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
resultSetHoldability - 結果セット保持力
戻り値:
モック用の準備されたステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql,
                                                  int resultSetType,
                                                  int resultSetConcurrency)
モック用の準備されたステートメントを作成します。

パラメータ:
sql - SQL
resultSetType - 結果セットタイプ
resultSetConcurrency - 結果セット同時並行性
戻り値:
モック用の準備されたステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int autoGeneratedKeys)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql,
                                                  int autoGeneratedKeys)
モック用の準備されたステートメントを返します。

パラメータ:
sql - SQL
autoGeneratedKeys - 自動生成されたキーを返すかどうかのフラグ
戻り値:
モック用の準備されたステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int[] columnIndices)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql,
                                                  int[] columnIndices)
モック用の準備されたステートメントを返します。

パラメータ:
sql - SQL
columnIndices - 自動生成された値を返して欲しいカラムの位置の配列
戻り値:
モック用の準備されたステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          String[] columnNames)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql,
                                                  String[] columnNames)
モック用の準備されたステートメントを返します。

パラメータ:
sql - SQL
columnNames - 自動生成された値を返して欲しいカラムの名前の配列
戻り値:
モック用の準備されたステートメント

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
定義:
インタフェース Connection 内の prepareStatement
例外:
SQLException

prepareMockStatement

public MockPreparedStatement prepareMockStatement(String sql)
モック用の準備されたステートメントを返します。

パラメータ:
sql - SQL
戻り値:
モック用の準備されたステートメント

releaseSavepoint

public void releaseSavepoint(Savepoint savepoint)
                      throws SQLException
定義:
インタフェース Connection 内の releaseSavepoint
例外:
SQLException

rollback

public void rollback()
              throws SQLException
定義:
インタフェース Connection 内の rollback
例外:
SQLException

isRolledback

public boolean isRolledback()
ロールバックしたかどうかを返します。

戻り値:
Returns ロールバックしたかどうか

setRolledback

public void setRolledback(boolean rolledback)
ロールバックしたかどうかを設定します。

パラメータ:
rolledback - ロールバックしたかどうか

rollback

public void rollback(Savepoint savepoint)
              throws SQLException
定義:
インタフェース Connection 内の rollback
例外:
SQLException

setAutoCommit

public void setAutoCommit(boolean autoCommit)
                   throws SQLException
定義:
インタフェース Connection 内の setAutoCommit
例外:
SQLException

setCatalog

public void setCatalog(String catalog)
                throws SQLException
定義:
インタフェース Connection 内の setCatalog
例外:
SQLException

setHoldability

public void setHoldability(int holdability)
                    throws SQLException
定義:
インタフェース Connection 内の setHoldability
例外:
SQLException

setReadOnly

public void setReadOnly(boolean readOnly)
                 throws SQLException
定義:
インタフェース Connection 内の setReadOnly
例外:
SQLException

setSavepoint

public Savepoint setSavepoint()
                       throws SQLException
定義:
インタフェース Connection 内の setSavepoint
例外:
SQLException

setSavepoint

public Savepoint setSavepoint(String name)
                       throws SQLException
定義:
インタフェース Connection 内の setSavepoint
例外:
SQLException

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws SQLException
定義:
インタフェース Connection 内の setTransactionIsolation
例外:
SQLException

setTypeMap

public void setTypeMap(Map arg0)
                throws SQLException
定義:
インタフェース Connection 内の setTypeMap
例外:
SQLException


Copyright ? 2004-2008 The Seasar Foundation. All Rights Reserved.