# com.bea.control
DatabaseControl Interface

public interface DatabaseControl
extends `Control`

Simplifies access to a relational database from your Java code using SQL commands. The Database control handles the work of connecting to the database, which makes it simpler to use than JDBC.
Note that only one of the methods of this interface (acceptChanges) is visible in Design View for a Database control in your application. You will typically not use the others. The best way to use a Database control is to add it to your design, then add to the control methods that capture the specific SQL expressions you want to execute against the database. Tasks such as getting a database connection are handled for you as you use the control.
For more information about using the Database control, see Database Control.

All Superinterfaces
  `Control`, `Control`, `Serializable`

## Nested Class Summary

`public static class` | `DatabaseControl.SQLFragment`
`public static class` | `DatabaseControl.SQLParameter`

## Method Summary

`public void` | `acceptChanges`(`RowSet` r) Wrapper for RowSet.acceptChanges().
`public `Connection`` | `getConnection`() Returns a database connection to the server associated with the control.
`public `Calendar`` | `getDataSourceCalendar`() Gets the Calendar instance used when setting and getting `Date```, `Time```, and `Timestamp``` values.
`public void` | `setDataSourceCalendar`(`Calendar` cal) Sets the Calendar instance that should be used when setting and getting `Date```, `Time```, and `Timestamp``` values.

## Method Detail

### acceptChanges(RowSet) Method

    public void acceptChanges(RowSet r)
         throws SQLException, OptimisticConflictException

Wrapper for RowSet.acceptChanges().

#### Exceptions

``SQLException``
``OptimisticConflictException``

### getConnection() Method

    public Connection getConnection()
         throws SQLException

Returns a database connection to the server associated with the control. It is typically not necessary to call this method when using the control.

#### Exceptions

``SQLException``

### getDataSourceCalendar() Method

    public Calendar getDataSourceCalendar()

Gets the Calendar instance used when setting and getting `Date```, `Time```, and `Timestamp``` values. This is the Calendar set by the setDataSourceCalendar method.

#### Returns

The Calendar instance.

### setDataSourceCalendar(Calendar) Method

    public void setDataSourceCalendar(Calendar cal)

Sets the Calendar instance that should be used when setting and getting `Date```, `Time```, and `Timestamp``` values.

Related Topics

``java.sql.ResultSet#getDate(int, Calendar)``
``java.sql.ResultSet#getTime(int, Calendar)``
``java.sql.ResultSet#getTimestamp(int, Calendar)``
``java.sql.PreparedStatement#setDate(int, Date, Calendar)``
``java.sql.PreparedStatement#setTime(int, Time, Calendar)``
``java.sql.PreparedStatement#setTimestamp(int, Timestamp, Calendar)``