Pentaho allows to define any number of datasources through Administration Console or plain INSERT statements in DATASOURCE table. Then you can use the given jndi names in your xaction. So if you have 20 xaction you write it 20 names. But what if the name must be changed for different enviroments or installations? It would be better don't harcode the jndi names, isn't it?
The solution is to write a simple xml to define available jndi names. Something like:
<xml>
<reporting_ds>MyDS</reporting_ds>
<etl_ds>MyETLDatasource</etl_ds>
</xml>
You only need to query this xml file in your xaction to obtain the jndi name before doing anyhting else. There's a really simple step process to query xml files using xpath expressions.
You can even put the whole querying process inside a xaction that you can call from any other xaction.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment