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 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 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