# New JDBC Resource: General Attributes

You see this page of the New File wizard when you are defining a JDBC resource. On this page you choose a connection pool and specify the JNDI name of the resource.

When making a connection to a relational database, the application calls up the JDBC resource using the JNDI resource name. The JDBC resource (datasource) specifies the connection pool used to connect to a database.

Use this page as follows:

To create a JDBC resource, you first need to define a connection pool. Choose one of the following connection pool options:

Element | Description
--- | ---
Use Existing JDBC Connection Pool | If selected, select from the drop-down list one of the connection pools already registered with the default server instance. If the connection pool you want does not appear in the list, ensure that it is registered with the default server instance. If no connection pools are listed and you see <No JDBC Connection Pool> in the drop-down list, ensure that the server instance is running.
Create New JDBC Connection Pool | Select this option to create a new connection pool in the wizard. Note: Alternatively, you can create a JDBC Connection Pool in the New File wizard. Click Back to return to the first screen of the New File wizard and select JDBC Connection Pool in the File Types pane.
JNDI name | The JNDI name for the resource is required and must be unique to this JDBC resource. The JNDI name of a JDBC resource is expected in the `java:comp/env/jdbc` subcontext. For example, the JNDI name for the resource of a payroll database could be j`ava:comp/env/jdbc/payrolldb`. Because all resource JNDI names are in the j`ava:comp/env subcontext`, when you specify the JNDI name of a JDBC resource enter only `jdbc/name`. For example, for a payroll database, specify jdbc/payrolldb. When looking up a resource, relative lookups are attempted when other lookup attempts fail. For example, a client can use context.lookup("`jdbc/payrolldb`") in the place of context.lookup("j`ava:comp/env/jdbc/payrolldb`") to look up the resource.
Object-types | The type of the object. You can choose from the following values.
system-all | A system resource for all server instances and the domain application server.
system-admin | A system resource only for the domain application server.
system-instance | A system resource for all server instances only.
user | A user resource.
Enabled | Set to true to enable the resource, or false to disable the resource.
Description | Description of the resource (optional).

Related Topics

Developing Applications with NetBeans IDE,

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.