|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Object
|
+--oracle.html.IHtmlItemImpl
|
+--oracle.html.Item
|
+--oracle.html.Table
|
+--oracle.html.DynamicTable
|
+--oracle.lite.web.html.DBTable
DBTableオブジェクトは、データベース表に直接関連付けられます。 DBTableオブジェクトはデータベースからデータをフェッチし、このデータをHTMLページ内に表示するために使用します。
例:
// Create a new DBTable associated with the database table EMP
DBTable dbTable = new DBTable("EMP");
// Add a primary key column.
dbTable.addColumn(new DBPrimaryKey("empno",DBColumn.NUMBER, "EmpNo","seq.nextval"));
// Add a regular column
dbTable.addColumn(new DBColumn("ename", DBColumn.VARCHAR2,"EName" ));
dbTable.setOrientation(DBTable.HORIZONTAL);// Set orientation of the records
try {
Connection c;
// Create a JDBC connection or use the JDBC Connection
// from the class OraUserProfile, which is part of the HttpServletRequest
dbTable.populate(c);
System.err.println(dbTable.toHTML());
}
catch (SQLException e) { }
| フィールドの概要 | |
static int |
HORIZONTAL
表内でのレコードの方向 |
static int |
VERTICAL
|
| コンストラクタの概要 | |
DBTable(java.lang.String tableName)
新しいDBTableオブジェクトを作成します。 |
|
| メソッドの概要 | |
DBTable |
addColumn(DBColumn dbC)
DBTableオブジェクトにデータベース列を追加します。 |
DBTable |
addColumn(java.lang.String colname, int datatype, java.lang.String label)
DBTableオブジェクトにデータベース列を追加します。 |
DBTable |
addCondition(java.lang.String clause)
推奨されません。 setWhereCondition()を使用してください。 |
DBTable |
addOrderCondition(java.lang.String clause)
SQL問合せにOrder By条件を追加します。 |
void |
fetchData(java.sql.Connection c)
推奨されません。 かわりにpopulate()を使用してください。 |
void |
populate(java.sql.Connection c)
データベースから実際の行を取り出し、HTML表に挿入します。 |
DBTable |
setExtraRows(int number_of_extra_rows)
表示される空レコードの数を制御します。 |
void |
setLabel(int colNumber, java.lang.String label)
指定された列のラベルを設定します。 |
DBTable |
setOrientation(int orientation)
データベースの全行の出力の方向を設定します。 |
DBTable |
setUpdateable(boolean flag)
全列を更新可能または読取り専用にする簡易メソッド。 |
DBTable |
setWhereCondition(java.lang.String clause)
SQL問合せにWHERE CLASS条件を追加します。 |
java.lang.String |
toHTML()
オブジェクトをHTML文字列として返します。 |
java.lang.String |
toString()
オブジェクトを文字列として返します。 |
| クラス oracle.html.DynamicTableから継承したメソッド |
addRow, addRow, addRow, getNumRows, setCellAt |
| クラス oracle.html.Tableから継承したメソッド |
backgroundColor, backgroundImage, border, borderColor, caption, captionAlign, cellPadding, cellspacing, endTag, frame, hAlign, rules, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBorder, setBorderColor, setBorderColor, setCaption, setCaption, setCellPadding, setCellSpacing, setFrame, setIHAlign, setRules, setWidth, startTag, width |
| クラス oracle.html.IHtmlItemImplから継承したメソッド |
print, print |
| クラス java.lang.Objectから継承したメソッド |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| フィールドの詳細 |
public static final int HORIZONTAL
public static final int VERTICAL
| コンストラクタの詳細 |
public DBTable(java.lang.String tableName)
tableName - ベース表の名前。| メソッドの詳細 |
public DBTable addColumn(java.lang.String colname,
int datatype,
java.lang.String label)
colName - ベース列の名前。datatype - ベース列のSQLデータ型。label - 列を表示するときに使用されるラベル。public DBTable addColumn(DBColumn dbC)
dbC - データベース列として記述される列。public DBTable addCondition(java.lang.String clause)
clause - 追加される条件。たとえば「empno = 1」など。public DBTable setWhereCondition(java.lang.String clause)
clause - 追加される条件。たとえばpublic DBTable addOrderCondition(java.lang.String clause)
clause - 追加されるOrder By条件。たとえば「ename」など。public DBTable setUpdateable(boolean flag)
flag - 全列を更新可能にする場合はTRUE、読取り専用にする場合はFALSE。
public void setLabel(int colNumber,
java.lang.String label)
throws java.lang.ArrayIndexOutOfBoundsException
colNumber - 列の番号で、1から開始します。label - 列を表示するときに使用されるラベル。public DBTable setOrientation(int orientation)
orientation - HORIZONTALまたはVERTICAL。public DBTable setExtraRows(int number_of_extra_rows)
number_of_extra_rows - 表示される空レコードの数。
public void populate(java.sql.Connection c)
throws java.sql.SQLException
c - データベース接続オブジェクト。
public void fetchData(java.sql.Connection c)
throws java.sql.SQLException
c - データベース接続オブジェクト。public java.lang.String toHTML()
public java.lang.String toString()
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||