All Downloads are FREE. Search and download functionalities are using the official Maven repository.

en.help.task-jdbcresourcenew.html Maven / Gradle / Ivy

There is a newer version: 8.0.0-JDK17-M7
Show newest version


To Create a JDBC Resource

A Java DataBase Connectivity (JDBC) resource (data source) provides applications with the means of connecting to a database.

Before You Begin

To create a JDBC resource, you must first create a JDBC connection pool. See To Create a JDBC Connection Pool.

  1. In the navigation tree, expand the Resources node.

  2. Under the Resources node, expand the JDBC node.

  3. Under the JDBC node, select the JDBC Resources node.

    The JDBC Resources page opens.

  4. On the JDBC Resources page, click New.

    The New JDBC Resource page opens.

  5. In the JNDI Name field, type a unique resource name.

    The JNDI name organizes and locates components within a distributed computing environment similarly to the way that card catalogs organize and represent locations of books in a library. Consequently, the JNDI name becomes an important method of accessing the JDBC resource. By convention, the name begins with the jdbc/ string, for example, jdbc/payrolldb. Don't forget the forward slash.

    The name must contain only alphanumeric, underscore, dash, or dot characters.

  6. From the Pool Name drop-down list, select a connection pool to be associated with the new JDBC resource.

  7. In the Description field, type a short description of the new JDBC resource.

  8. Select the Status Enabled checkbox to make the resource available at runtime.

    This option is enabled by default.

  9. In the Additional Properties section, specify additional properties.

    GlassFish Server does not define any additional properties for JDBC resources.

    To add a property, click the Add Property button. In the blank row that appears, type the property name in the Name field, and type the property value in the Value field.

  10. Select an Available Target to Add it or remove it from the Selected Targets list.

  11. Click OK.

See Also
Copyright © 2005, 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices




© 2015 - 2024 Weber Informatics LLC | Privacy Policy