To create a JNDI DataSource object

  1. Create the directory structure recommended in the topic JDBC Resources.
  2. Using any text editor, create a file in your JDBC root directory using the following naming convention:

    dataSourceName.properties

    where dataSourceName is a name you choose to describe the data source.

    For example, /home/jdbcrsc/MSSQL.properties.

  3. Include the following content in the file:
    type=javax.sql.DataSource
    driver=driverClass
    url=JDBC-URL
    user=userID
    password=password
    Where:
    driverClass The name of the JDBC driver's main class.
    JDBC-URL A URL that identifies the server and database.
    userID The user ID required to log onto the server and database. If not required by the database or if the user ID is supplied by your application at runtime, leave the value blank.
    password The password that accompanies the specified user ID. If not required by the database or if the password is supplied by your application at runtime, leave the value blank.

For more information on driver classes, see JDBC Driver Classes. For more information on JDBC URLs, see JDBC URLs. To see several example DataSource object files, see Sample DataSource Object Files.