Connecting to a Database

See Also

Once the drivers for your database have been added and are visible in the Databases node, you can open a connection to the database.

Once the initial connection has been made you can do the following:

To open a new connection:

  1. Check to make sure that your database is running.
  2. In the Runtime window, expand the Databases node and the Drivers node.
  3. Right-click your driver's instance node and choose Connect Using.
  4. In the New Database Connection dialog box, ensure the correct driver is selected in the Driver field.
  5. Provide the JDBC URL for the database connection in the Database URL field.

    This URL typically begins with jdbc:and a short code name for the driver, followed by another colon. The rest of the URL depends on the type of driver you are using. For example, you might need to specify a host and port; alternatively, the name of a database file might suffice, or an ODBC DSN. For MySQL, the Database URL might look as follows:

    jdbc:mysql://localhost:3306/mydatabase
    To help you get started, existing drivers are provided with templates for the correct URL format. If in doubt, refer to the documentation for the driver you are using.

  6. Provide the user name and password, if required by your database configuration.
  7. Click the Remember Password checkbox to have the IDE remember your password.

    The password is saved only for the current IDE session. After restarting the IDE, you must type the password again.

  8. Click OK to connect the IDE to the database.

If the connection is successful, the database connection node appears as a subnode of the Databases node. The database connection node appears whole (  ) indicating the database is connected. When the database is connected, you can expand the database connection node to see the child folders representing lists of tables, views and procedures. For more, see Browsing Structures.

If the connection attempt fails, the IDE displays a dialog box indicating the connection is broken and the database connection node is broken. Check the connection information for the database and create a new connection.

To disconnect from the database:

  1. Right-click the database connection node and choose Disconnect from the contextual menu.

    You cannot browse the database until you reconnect to the database.

See Also
Adding a New JDBC Driver

Legal Notices