Connecting to a Java DB Database

See Also

The Java DB database is a 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 Glassfish application server.

If you install the GlassFish application server 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 the Databases Node in the Services 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. In the Services window, right-click the Java DB node and choose Create Database.
  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. To change the default location, click Properties in the Create Java DB Database dialog box, or in the Services window, right-click the Java DB node and choose Properties. Type the new database location in the appropriate field.

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 Locate Driver step of the New Connection wizard, choose one of the following Java DB drivers from the drop-down menu:
  3. In the Customize Connection dialog box of the New Connection wizard, enter the database name to which you want to connect.
  4. Provide the database user name and password.
  5. (Optional) Click Test Connection to see if the connection can be established.
  6. 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