Help Topics Concepts Package Class

## Database Export Bean Properties and Use

### Properties

The Database Export Bean panel provides these options; see the Sample Connection Data for some valid combinations.

Driver name
  The name of the JBDC driver to load. Defaults to IBM's DB2. Case is significant. This field is editable, and any additions are preserved in the Able.properties file. The class will be dynamically loaded and must be in your CLASSPATH before starting the Agent Editor.
Protocol
  The name of the protocol to use when creating an SQL connection. Defaults to "jdbc". This field is editable, and any additions are preserved in the Able.properties file.
Subprotocol
  The subprotocol to use when creating an SQL connection. Defaults to "db2". This field is editable, and any additions are preserved in the Able.properties file.
Database
  The database to use when creating an SQL connection. This field is editable, and any additions are preserved in the Able.properties file. For local databases, just enter the name of a database such as SampleDB. For remote databases, enter the system name and database using the '//' format, for example //dbserver/SampleDB.
Options
  Any options to be included in the JDBC URL for the URL parameter of the DriverManager's getConnection method. This value is optional. Some databases will require an option of 'create=true' to allow tables or databases to be created dynamically.
Userid
  The userid to use when creating an SQL connection.
Password
  The password used for the SQL connection. The password is not saved when the bean is serialized.
Schema
  The schema containing the desired table. In some database implementations, this is the table owner.
Table
  The name of the table to be written.
Creatable from input buffer
  If the table does not currently exist, create it based on the data type of the inputs. The table is not created until the export bean is processed.
Row selection
  If provided, the value is used to specify which rows to delete from the table. The value in the field becomes part of the delete immediately after the word "WHERE". Do not include "WHERE" in this String; if data is provided, it will be included automatically.

### Use

The Database Export Bean panel is used to connect to an SQL database and write records to a table. It can also be used to drop or delete rows in a table.

To prepare the bean to receive data:

1. Enter the Driver, Protocol, Subprotocol, Database, and any Options necessary to create the SQL database connection.
2. Enter the Schema and Table name where data is to be written.
3. Check the Createable box if you wish a table to be created dynamically if needed.
4. Press the Open Table button. This will create a connection for use during processing.

To drop a table:

1. Enter the Driver, Protocol, Subprotocol, Database and any Options necessary to create the SQL database connection.
2. Enter the Schema and Table name to be dropped.
3. Press the Drop Table button.

To delete rows from a table:

1. Enter the Driver, Protocol, Subprotocol, Database, and any Options necessary to create the SQL database connection.
2. Enter the Schema and Table name to be dropped.
3. Press the Open Table button.
4. If you wish to delete specific rows, enter the desired SQL statement without the "WHERE" lead-in in the row selection field. Leaving this blank will cause all rows to be removed.
5. Press the Delete button to remove the specified rows.