Working with JNDI

Applications such as GeoServer are in position to work with database connection pools set up by the application server. The Java Naming and Directory Interface (JNDI) can be used to create a connection pool for a JDBC data source.

In Boundless Server Enterprise, JNDI can be configured using an application.yml resource file. Please refer to Application Configuration.

An example JNDI resource file for application-jndi.yml might look like this:

bse:
  jndi:
    sources:
      -
        name: jdbc/postgres
        properties:
          url: jdbc:postgresql://localhost:5432/na_roads
          username: docker
          password: docker
      -
        name: jdbc/postgres
        properties:
          url: jdbc:postgresql://localhost:5432/na_roads
          username: docker
          password: docker

Note

For more information about the possible parameters and their values refer to the DBCP documentation.

When adding a store in GeoServer, select the JNDI option. Enter the following information:

  • The jndiReferenceName used by the application server.
  • The schema used by the database.

Using the configuration example above, the jndiReferenceName would be jdbc/postgres.