Previous Topic Next topic Print topic


JNDI

Enables you to specify a JNDI class to use to look up the connection string for the data source name specified in the EXEC SQL CONNECT statements, or at compile time as specified by the SQL(DB) compiler directive if the SQL(CHECK) compiler directive is also specified.
Important: We highly recommend that you code EXEC SQL CONNECT statements into your application for use at runtime rather than using the INIT directive to generate the code for the connection to the database.

Syntax:

JNDI=JNDIContextFactoryClassName

Parameters:

JNDIContextFactoryClassName The Java context factory class name.

Properties:

Default: An empty string.

Scope:

Used at compile time: Yes
Behavior at run time: Process

See Scope - OpenESQL SQL Compiler Directive Options for more information.

Comments:

JNDI is effective at both compile time and runtime.

JNDI is equivalent to setting the Context.INITIAL_CONTEXT_FACTORY class in a Java application.

We do not recommend using Simple-JNDI for production deployment; however, when doing initial testing with a Java application server, you can use Simple-JNDI rather than the application server's JNDI implementation. To do this, specify:

SQL(JNDI=org.osjava.sj.SimpleContextFactory)

Previous Topic Next topic Print topic