Creating a New JDBC control

A JDBC control makes it easy to access a relational database via SQL commands. When you create a new JDBC control, you specify which database it connects to and write methods to access data using SQL commands. This topic describes the mechanics of creating a JDBC control.

Choosing a Data Source

Before you can perform operations on a database, you must have a connection to the database. The JDBC control handles all of the details of managing the database connection, but you must supply the name of a data source that has been configured with the information necessary to access a database.

To learn how to create, configure and register a data source, see the documentation provided for WebLogic Server.

Adding a JDBC control

You can add a JDBC control in any of the following types of files:

To create a new JDBC control:

  1. Locate or create the package (folder) where you want to create the JDBC control. This can be a package in a utility project, dynamic web project, or web service project.
  2. Right-click the package and choose New > JDBC Control. The New Control dialog opens.
  3. In the Control name field, enter the name of the new JDBC control. Click Next.

  4. Click the Browse button to select the data source.

    The JNDI Entries dialog appears. Navigate to the data source you want to select and click Select.

  5. Click Finish.

To learn how to add a method to a JDBC control, see Adding a Method to a JDBC control.

 

Related Topics

System Controls Overview

JDBC control


Still need help? Post a question on the Workshop newsgroup.