We are going to copy PRD libraries into our project. We will then create a new folder within our project and copy a PRD report inside it. Finally, we will modify the connection type of this report so that it utilizes JNDI.
lib
folder in PRD_HOME]
, select every file in there, and copy it with Ctrl + C; then in Eclipse, select the node named prd5ch14 by going to WebContent | WEB-INF | lib and paste the copied files in there by pressing Ctrl + V.jsp-api-2.0.jar
and delete it.report
.11_Adding_Charts.prpt
, and copy it (Ctrl + C). In Eclipse, we will select the node named report by going to WEB-INF and paste the copied report in there (Ctrl + V):[WORKSPACE_HOME]/prd5Ch14/WebContent/WEB-INF/report/11_Adding_Charts.prpt
.sakila jndi
JNDI
sakila
The dialog will look like the following screenshot:
In JNDI Name we will set the value sakila, but you may have noticed that in the file context.xml
we used the value name jdbc/sakila
. This is because the API will take care of completing the name for us by following the standard.
We will click on OK to save the new connection.
If we want to use this report from the publisher through JNDI, we need to edit the file default.properties
present in the location [User_home]/.pentaho/single-jndi
and add the following configuration at the end:
sakila/type=javax.sql.DataSource
sakila/driver=com.mysql.jdbc.Drivers
sakila/user=root
sakila/password=root
sakila/url=jdbc:mysql://localhost:3306/sakila
For more information visit http://infocenter.pentaho.com/help/index.jsp?topic=%2Freport_designer_user_guide%2Ftask_jndi_data_source.html.
We copied the PRD libraries placed in [PRD_HOME]/lib
and pasted them into our project within the lib node located in WEB-INF. We also created a folder within the WEB-INF node, called it report
, and pasted inside it the report named 11_Adding_Charts.prpt
. By means of PRD, we opened the previously mentioned report and edited its data sets so that they are of the type JNDI.