You can interact directly with an SQL database with a SimpleSQLFormHandler, which is an instance of the class atg.droplet.sql.SimpleSQLFormHandler. A subclass of atg.droplet.GenericFormHandler, this class supports SQL database table queries, inserts, updates, and deletions. The form handler requires that each row be uniquely identified by a set of key columns; consequently, the form handler can act on only one row at a time.

The SimpleSQLFormHandler lets you interact with a SQL database directly, by specifying the table rows to query or update. This form handler relies only minimally on the repository layer, it requires you to know exactly which items are required.

When you create a SimpleSQLFormHandler, you set the following properties:

You can embed this component in JSP forms. The form fields are used to set the form handler’s value property. The value property is a Dictionary whose subproperties store values that identify the row that is currently accessed by the form, indexed by column name. The value subproperties can be keys used to look up an item or new values for update and insert operations. After lookup operation, these subproperties are set to the returned row.

 
loading table of contents...