Connecting to a Java DB Database

See Also

The Java DB database is Sun's supported distribution of the open source Apache Derby database. Java DB is a fully transactional, secure, standards-based database server, written fully in the Java programming language, and fully supports SQL, JDBC API, and Java EE technology. The Java DB database server is bundled with the Sun Java System Application Server/Glassfish. If you install the Sun Java Application Server/GlassFish during the IDE installation, the Java DB database server is automatically registered in the IDE.

To enable the Java DB database server in the IDE, do one of the following:

Once your Java DB database is registered with the IDE, the Java DB Database menu item appears under Tools in the main window. This menu item enables you to easily start and stop the Java DB database server, and to create a new database.

To create a new Java DB database:

  1. Choose Tools > Java DB Database > Create Java DB Database from the main menu.
  2. In the Create Java DB Database dialog box, enter a name for the database, a user name, and a password.

    By default, the IDE creates the database in the .netbeans-derby folder of your home directory. You can change the default location by clicking Settings in the Create Java DB Database dialog box or by choosing Tools > Java DB Database > Java DB Settings from the main menu and setting the Database Location property.

To connect to an existing Java DB database:

  1. In the Services window, right-click the Databases node and choose New Connection.
  2. In the New Database Connection dialog box, choose one of the following Java DB drivers from the drop-down menu:
  3. Enter the URL of the database. The URL format is given in the textbox:
    jdbc:derby://<HOST>[:<PORT>]/<DB>
  4. Enter a user name and password.
  5. Click OK. The IDE displays the connection to the database under the Databases node in the Services window.

Notes:

See Also
Connecting to a Database

Legal Notices