PDI JNDI

(PDI-1617)As an ETL developer, I would like to use JNDI with the jdbc.properties file in an easy way (without an application server environment)

(PDI-1718) Kitchen.sh does not use the JNDI settings in simple-jndi/jdbc.properties

http://forums.pentaho.org/showthread.php?t=56167

-Djava.naming.factory.initial="org.osjava.sj.SimpleContextFactory" -Dorg.osjava.sj.root="D:/pentaho/pentaho1.53/kettle250/simple-jndi" -Dorg.osjava.sj.delimiter="/"

 

1.java.naming.factory.initial. For example, "org.osjava.sj.SimpleContextFactory".
2.org.osjava.sj.root. For example, "D:/pentaho/pentaho1.53/kettle250/simple-jndi".
3.org.osjava.sj.delimiter. For example, "/".

 

 

JNDI

simple-jndi/jdbc.properties

 

    private void initJNDI() {
          String path = ""; //$NON-NLS-1$
          try      {
              File file = new File("simple-jndi"); //$NON-NLS-1$
              path = file.getCanonicalPath();
          }  catch (Exception e)   {
              log.logError(toString(), "Error initializing JNDI", e);
          }
          System.setProperty("java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory"); //$NON-NLS-1$ //$NON-NLS-2$
          System.setProperty("org.osjava.sj.root", path); //$NON-NLS-1$ //$NON-NLS-2$
          System.setProperty("org.osjava.sj.delimiter", "/"); //$NON-NLS-1$ //$NON-NLS-2$
    }

 

Sample

SampleData/type=javax.sql.DataSource
SampleData/driver=org.hsqldb.jdbcDriver
SampleData/url=jdbc:hsqldb:hsql://localhost/sampledata
SampleData/user=pentaho_user
SampleData/password=password