Since Domino 8.5.3 it's possible to access relational databases directly from XPages. See this article from Amy K. Hoerle for details.
In short:
- Make sure you're using Domino 8.5.3.
- Create a new updatesite.nsf database out of the updatesite.ntf template.
- Download the latest version of the Extension Library from OpenNTF, open the updatesite.nsf, select "Import Local Update Site", select the site.xml from the Extension Library package.
- Add OSGI_HTTP_DYNAMIC_BUNDLES=updatesite.nsf to the notes.ini of your Domino server
- Restart http. Afterr restarting you should see a message like "HTTP JVM...NSF based plugins are being installed n the OSGi runtime".
- Install the Extension Library in the Domino Designer, too, by using menu File -> Application -> Install.
- Install a JDBC database driver for your relational database by copying it's JAR file to your Designer client (notesprogram/jvm/lib/ext) and server (dominodata/workspace/applications/eclipse/plugins).
- Test the setup by copying the "XPages Extension Library Demo" and "XPagesJDBC sample" from the ExtLib to your Domino server. Open the JDBCSample in a browser, click "Setup".
- Create a JDBC connection file in the WebContent/WEB-INF/jdbc folder of your XPages application (use package explorer window in Domino Designer). The file is an XML file, use the sample in the JDBCSample database as a basis.
- Create a new XPage, drop a view control onto it, and select "JDBC data source" as data source.
- In the "All properties" section of the view control, define Data/Connection Name, Data/sqlQuery and Data/var.
Thanks to Amy K. Hoerle for describing this!
|