This topic describes common tasks that you can perform with database connections, often by clicking the Databases node in the
. For more detailed information, click the links in the right column.
Before working with a database, you must ensure that the database server is installed and running. To start the Java DB Database Server, in the Services window, click Databases > Java DB > Start Server. To start the MySQL Database Server, in the Services window, choose Databases > MySQL Server > Start. If the MySQL Database Server in not connected, choose Databases > MySQL Server > Connect.
To perform this task...
Follow these steps
Add a database connection to the Services window
In the
, right-click the Databases node and choose New Connection.
In the New Database Connection dialog box, specify the database information.
Click OK.
Add a database table to a Visual Web JSF page
In the , expand the Databases node.
Expand the database-name node.
Expand the Tables node.
Drag the database table into the Visual Designer.
Add a JDBC driver
In the
, expand the Databases node, right-click the Drivers node , and choose New Driver.
In the New JDBC Driver dialog box, type the name of the new driver file.
Click OK.
Bind data to list components (such as Listbox) in the Basic category of the Palette
Drag the database table from the
and drop it onto the page.
Right-click the component to which you want to bind the data and choose Bind to Data.
Bind data to simple components (such as Button) in the Basic category of the Palette
Drag and dop the database table from the
onto the Visual Designer.
Right-click the component to which you want to bind the data and choose Bind to Data.
In the Bind to Data dialog box, choose the data provider and data field to which the bind the component.