Modify Bean

The Modify bean is a non-visual bean. Using the Modify bean you can insert, update, delete rows in the database without first running a query. 

The Modify bean has an action property which specifies how to connect to a database and defines an SQL statement. Other properties allow you to get information such as whether the SQL statement has been executed and how many rows in the database were affected by it.

The Modify bean provides an execute method that executes the SQL statement and methods to commit or roll back the changes to the database. To use the Modify bean, you connect an interface component to it. For example, you can make an event-to-method connection between the actionPerformed event for a button and the execute method of the Modify bean. When the button is selected, the SQL statement specified in the action property is executed.

The Modify bean is intended to run SQL INSERT, UPDATE and DELETE statements. However, it can run any valid SQL statement, but it will not return a result set. Use a Select or ProcedureCall bean to obtain result sets. Because the Modify bean doesn't return a result set, you cannot use the DBNavigator bean with it.   

 


Connection Aliases and SQL Specifications
Parameterized SQL Statements
Select Bean
ProcedureCall Bean


Accessing Relational Data