DBNavigator

Use the DBNavigator bean with a Select bean to access relational data. The DBNavigator bean provides a set of Buttons that execute the SQL statement for the associated Select bean; perform other relational database operations, such as commit updates to the database; and navigate rows in the result set. The DBNavigator bean is a Swing component, and requires the Java Foundation Classes (JFC) library.

Palette category
Database
Palette bean
DBNavigator
Project
IBM Data Access Beans
Package
com.ibm.ivj.db.uibeans
Type
DBNavigator

The DBNavigator bean has the following properties:

beanName
Specifies the name of the DBNavigator bean instance. It must follow standard naming rules for beans. The default name is DBNavigatorn, where n is the number of DBNavigator beans with default names; for example, the first default name isDBNavigator1.

model
Used to associate the DBNavigator bean with the Select bean. The default is a null value.

showCommit
Specifies if the Commit button is displayed.

A value of True means that the Commit button is displayed. A False value means that the Commit button is not displayed. The default value is True.

showDelete
Specifies if the Delete button is displayed.

A value of True means that the Delete button is displayed. A False value means that the Delete button is not displayed. The default value is True.

showExecute
Specifies if the Execute button is displayed.

A value of True means that the Execute button is displayed. A False value means that the Execute button is not displayed. The default value is True.

showFirst
Specifies if the First button is displayed.

A value of True means that the First button is displayed. A False value means that the First button is not displayed. The default value is True.

showInsert
Specifies if the Insert button is displayed.

A value of True means that the Insert button is displayed. A False value means that the Insert button is not displayed. The default value is True.

showLast
Specifies if the Last button is displayed.

A value of True means that the Last button is displayed. A False value means that the Last button is not displayed. The default value is True.

showNext
Specifies if the Next button is displayed.

A value of True means that the Next button is displayed. A False value means that the Next button is not displayed. The default value is True.

showPrevious
Specifies if the Previous button is displayed.

A value of True means that the Previous button is displayed. A False value means that the Previous button is not displayed. The default value is True.

showRefresh
Specifies if the Refresh button is displayed.

A value of True means that the Refresh button is displayed. A False value means that the Refresh button is not displayed. The default value is True.

showRollback
Specifies if the Rollback button is displayed.

A value of True means that the Rollback button is displayed. A False value means that the Rollback button is not displayed. The default value is True.

toolTipsEnabled
Specifies if tool tips are enabled for the buttons. Tool tips are short descriptions of an interface element, such as a button.

A value of True means that tool tips are enabled for the buttons. A False value means that tool tips are not enabled for the buttons. The default value is True.

Buttons

The buttons that can be displayed with the DBNavigator bean are as follows:


Commit button
Commit. Commits any uncommitted changes to the database made by the associated Select bean or made by any other Select bean that shares the connection alias with the associated Select bean.


Delete button
Delete. Deletes the current row of the associated Select bean. If the control that displays the data is connected to the bound column properties of the Select bean, its display changes to reflect the deleted row.


Execute button
Execute. Connects to the database, if necessary, using the connection specified in the connection alias for the associated Select bean, and executes the SQL statement for the associated Select bean.


First button
First. Sets the currentRow property of the associated Select bean to the first row in the result set. If the control that displays the data is connected to the bound column properties of the Select bean, its displays data from the first row in the result set.


Insert button
Insert. Inserts a new, blank row in the result set at the position specified by the currentRow property of the associated Select bean. If the control that displays the data is connected to the bound column properties of the Select bean, it displays blanks.


Last button
Last. Sets the currentRow property of the associated Select bean to the last row in the result set. If the control that displays the data is connected to the bound column properties of the Select bean, it displays data from the last row in the result set.


Next button
Next. Sets the currentRow property of the associated Select bean to the next row in the result set. If the control that displays the data is connected to the bound column properties of the Select bean, it displays data from the next row in the result set.


Previous button
Previous. Sets the currentRow property of the associated Select bean to the previous row in the result set. If the control that displays the data is connected to the bound column properties of the Select bean, it displays data from the previous row in the result set.


Refresh button
Refresh. Executes the SQL statement for the associated Select bean. It is designed to reexecute an SQL statement that was previously executed. The button does not reconnect to the database. If the SQL statement is changed after its initial invocation, the initial version of the query is executed.


Rollback button
Rollback. Rolls back any uncommitted changes to the database made by the associated Select bean or made by any other Select bean that shares the connection alias with the associated Select bean.


Related procedures
Accessing Relational Data

Related references
Select