com.hamaf.hikyaku.access
クラス AccessBase

java.lang.Object
  上位を拡張 com.hamaf.hikyaku.access.AccessBase
直系の既知のサブクラス:
DefaultTableAccess, MultipleAccessBase, PreparedSqlAccess

public abstract class AccessBase
extends java.lang.Object

タイトル:AccessBase is Accessor Class base.

説明:アクセスクラス用のベースクラス。


DBコネクションはコンストラクタでTomcatのConnection Poolより取得します。
TomcatでのResource名は"dbc/Hikyaku"となります。
以下のメソッドが定義されています。
  1. getStatement() - Statementを取得する
  2. closeStatement() - Statementをクローズする
  3. destroy() - DataBase Connectionを開放する
    Statementが開いていれば、それも閉じます。
  4. exclusion() - 排他チェックを行い、排他エラーの場合例外を投げる

著作権: Copyright (c) 2004/06/16

バージョン:
1.0
作成者:
y-hamanaka

フィールドの概要
protected  java.sql.Connection _conn
           
protected  DbConnectInterface _DbConnect
           
protected  java.sql.Statement _stmt
           
 
コンストラクタの概要
AccessBase()
           
 
メソッドの概要
protected  void closeStatement()
          Describe closeStatement method : close Statement.
protected  void destroy()
          Describe destroy method : close Connection.
protected  void exclusion(DetailItemsInterface dii, java.lang.String tableName)
          Describe exclusion method : check exclusion.
protected  java.util.List<java.lang.String> getPkeys(java.lang.String tableName)
          Describe pkeys method : return PrimaryKeys name.
protected  java.lang.String getProductName()
          Describe getProductName method : get DatabaseProductName.
protected  java.sql.Statement getStatement()
          Describe getStatement method : get DB Statement.
protected  void setConnection(java.lang.String param, java.lang.String sysId)
          Describe getConnection method : get DB Connection from pool.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

_DbConnect

protected DbConnectInterface _DbConnect

_conn

protected java.sql.Connection _conn

_stmt

protected java.sql.Statement _stmt
コンストラクタの詳細

AccessBase

public AccessBase()
メソッドの詳細

setConnection

protected final void setConnection(java.lang.String param,
                                   java.lang.String sysId)
Describe getConnection method : get DB Connection from pool.
DBのコネクションプールよりアクティブな接続オブジェクトを取得する。

パラメータ:
param - a String : パラメータ
sysId - a String : システムID

getStatement

protected java.sql.Statement getStatement()
                                   throws java.sql.SQLException
Describe getStatement method : get DB Statement.
ステートメント オブジェクトを生成して戻す。

戻り値:
a Statement : 生成したStatment
例外:
java.sql.SQLException

closeStatement

protected final void closeStatement()
                             throws java.sql.SQLException
Describe closeStatement method : close Statement.
使用済みのStatement Objectを閉じる。

例外:
java.sql.SQLException

destroy

protected final void destroy()
                      throws java.sql.SQLException
Describe destroy method : close Connection.
使用済みのDB Connectionを開放する。

例外:
java.sql.SQLException - a void :

exclusion

protected final void exclusion(DetailItemsInterface dii,
                               java.lang.String tableName)
                        throws ExclusionException,
                               java.sql.SQLException
Describe exclusion method : check exclusion.
規定の項目名称を用いて、AbstDataObjDaoSelectBaseを元に排他処理を行う。
排他エラーが発生した場合、例外(ExclusionException)を投げます。

パラメータ:
dataObj - a : 更新を行うData Object
sb - a String : 更新を行うテーブル名
例外:
ExclusionException - : 排他エラーの場合、投げる例外
java.sql.SQLException

getPkeys

protected final java.util.List<java.lang.String> getPkeys(java.lang.String tableName)
                                                   throws java.sql.SQLException
Describe pkeys method : return PrimaryKeys name. PrimaryKey のカラム名が定義順に設定される。

パラメータ:
table - a String : PrimaryKey を取得するテーブル名
戻り値:
a List : 取得したPrimaryKey項目名の一覧
例外:
java.lang.Exception
java.sql.SQLException

getProductName

protected final java.lang.String getProductName()
                                         throws java.sql.SQLException
Describe getProductName method : get DatabaseProductName.
DatabaseProductNameを取得する。

戻り値:
a String : atabaseProductName
例外:
java.sql.SQLException