|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.zentense.step2.view.View
com.zentense.step2.view.ResultSetView
public class ResultSetView
A view is a collection of rows where a row is a collection of columns. Rows are
ordered while columns are not (although in ResultSetViews are also ordered).
Views are used mainly to show or process data.
A ResultSetView is a view created by a ResultSetModel after executing a SQL
statement on a database through JDBC. The ResultSetView encapsulates the
resulting JDBC Resultset.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.zentense.step2.view.View |
|---|
View.Empty |
| Field Summary |
|---|
| Fields inherited from class com.zentense.step2.view.View |
|---|
EMPTY |
| Constructor Summary | |
|---|---|
ResultSetView()
Default constructor |
|
ResultSetView(java.sql.Connection db,
int type,
int concur)
Creates and initializes a ResultSetView |
|
| Method Summary | |
|---|---|
void |
close()
Closes statement. |
static java.sql.PreparedStatement |
createPrepared(java.sql.Connection db,
java.lang.String sql,
int type,
int concur)
Creates a prepared statement |
View |
execPrepared(java.sql.PreparedStatement ps)
Executes a prepared statement. |
void |
executeQuery(java.lang.String sql)
Executes SQL query. |
void |
executeUpdate(java.lang.String sql)
Executes SQL statement with no results. |
void |
finalize()
|
View |
first()
|
java.lang.Object |
get(int idx)
Gets the n-th column of current row |
java.lang.Object |
get(java.lang.String colName)
Gets a column value |
java.lang.String[] |
getCols()
Returns view columns |
int |
getCount()
Gets results total size |
int |
getOrdinal()
Gets the current position of this view. |
java.sql.ResultSet |
getResultSet()
Gets JDBC Resultset |
int |
getSize()
Gets results size. |
int |
getStart()
Returns the first visible row in this view. |
java.sql.Statement |
getStatement()
Gets JDBC Statement |
void |
insertRow()
Inserts current row into database. |
boolean |
next()
Advances the view to the next row. |
void |
open()
Position the view before the first visible row |
void |
set(java.lang.String colName,
java.lang.Object obj)
Sets a (key, value) pair. |
void |
setPageBounds(int begin,
int step)
Unboxed version of setPageBounds |
void |
setPosition(int pos)
Moves to another row in view |
java.lang.String |
toString()
Returns an string representation of this object |
void |
updateRow()
Updates current row into database. |
| Methods inherited from class com.zentense.step2.view.View |
|---|
asDelegated, asDelegatedResultSet, asResultSet, fillFromRow, fillRowFromRequest, getBool, getCachedClone, getColsAsView, getDouble, getIndent, getInt, getRow, getRow, getSum, randomPosition, setPageBounds, setPageBounds, setPageBounds |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResultSetView()
public ResultSetView(java.sql.Connection db,
int type,
int concur)
throws java.sql.SQLException
db - JDBC connectiontype - Resultset type (TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE)concur - Resultset concurrency (CONCUR_READ_ONLY, CONCUR_UPDATABLE)
java.sql.SQLException| Method Detail |
|---|
public static final java.sql.PreparedStatement createPrepared(java.sql.Connection db,
java.lang.String sql,
int type,
int concur)
throws java.sql.SQLException
db - JDBC connectionsql - SQL statement to be preparedtype - Resultset type (TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE)concur - Resultset concurrency (CONCUR_READ_ONLY, CONCUR_UPDATABLE)
java.sql.SQLException
public View execPrepared(java.sql.PreparedStatement ps)
throws java.sql.SQLException
java.sql.SQLExceptionpublic final java.sql.Statement getStatement()
public final java.sql.ResultSet getResultSet()
public final void close()
public final void setPageBounds(int begin,
int step)
throws java.sql.SQLException
setPageBounds in class Viewbegin - First row in pagestep - Number of rows in page
java.sql.SQLExceptionpublic View first()
first in class View
public void open()
throws java.lang.Exception
View
open in class Viewjava.lang.Exception
public boolean next()
throws java.lang.Exception
View
next in class Viewjava.lang.Exception
public final void executeQuery(java.lang.String sql)
throws java.sql.SQLException
java.sql.SQLException
public final void executeUpdate(java.lang.String sql)
throws java.sql.SQLException
java.sql.SQLExceptionpublic int getStart()
View
getStart in class ViewView#setPageBounds(Integer, Integer)
public int getCount()
throws java.lang.Exception
getCount in class Viewjava.lang.Exception
public int getSize()
throws java.lang.Exception
getSize in class Viewjava.lang.Exception
public int getOrdinal()
throws java.lang.Exception
View
getOrdinal in class Viewjava.lang.Exception
public void setPosition(int pos)
throws java.lang.Exception
View
setPosition in class Viewjava.lang.Exception
public final void set(java.lang.String colName,
java.lang.Object obj)
throws java.lang.Exception
set in class ViewcolName - Column name (key)obj - Value
java.lang.Exception
public java.lang.Object get(java.lang.String colName)
throws java.lang.Exception
View
get in class ViewcolName - Column name (key)
java.lang.Exception
public final java.lang.Object get(int idx)
throws java.lang.Exception
java.lang.Exception
public java.lang.String[] getCols()
throws java.lang.Exception
View
getCols in class Viewjava.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.Object
public final void insertRow()
throws java.sql.SQLException
insertRow in class Viewjava.sql.SQLExceptioncom.zentense.step2.model.ResultSetModel#insertMode(RequestRuntime)
public final void updateRow()
throws java.sql.SQLException
updateRow in class Viewjava.sql.SQLExceptioncom.zentense.step2.model.ResultSetModel#insertMode(RequestRuntime)
public void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||