This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
XPages Extension Library OpenNTF 8.5.3 andIBM position in regards to official support (cont.)
● Notes/Domino 8.5.3 targeting version was initially released on October 17th, 2011.
● As of November 18th latest release is provided via file named:ExtensionLibraryOpenNTF-853.20111027-1245a.zip
● From News section you should read this important post:
XPages Extension Library - News: October 20th Release - Notes from Peter Janzen where you'll find such statement about this release:
- “It sets the stage for many of the controls and objects to become asupported set of features for Lotus Notes and Domino.” That means thatwhile this project will continue its existence as an OpenNTF project – partof it with the same code base will be officially supported by IBM.
● There are now 2 sets of plugins included in OpenNTF delivery -“extlib” and “extlibx”. The one called “extlibx” contains now someexperimental code (like XPages Relational) and will be added toofficial support when it will be mature enough for that.
For connection to DB2, MS SQL, mySQL, Oracle and other databasesyou may need to prepare your own plugin, which will wrap specificdatabase JDBC driver (usually available as 1 or 2 vendor's jar files)and then deploy it either to Domino server or Designer client or both
● Currently sample DB2, MS SQL, mySQL (Oracle to follow soon) plugins/update sites with source code are provided on OpenNTF website
● For the purpose of this webinar we'll use freely available DB2 Express-C v9.7.4 RDBMS
● We'll use also Sample DB2 driver update site available asExtlib_8.5.3_DB2_Driver_updateSite201110201044.zip. This update site wraps DB2 JDBC driver, available for download from IBM site
● Verification: tell http osgi ss extlib.driver.db2
With XPages Extension Library you get also demo application, calledXPagesJDBC.nsf , which demonstrates main functionality currentlyavailable for Relational support. You need to copy it to your server (here we'll have it under <Domino_Data>/demo directory) and signwith some user/server ID. If steps were done correctly till this moment- you'll see:
At this moment you cannot open yet XPagesJDBC.nsf demoapplication inside your Domino Designer if you have option Project →Build Automatically switched on (which is default), because we don'thave yet required plugins installed for Domino Designer and you'll geta lot of compilation errors making demo application inaccessible fromyour server
● With Extension Library delivery ZIP you get only embedded Derbydatabase driver installed for quick testing and demo application isconfigured to use it. We'll change that later using Domino Designer touse DB2 driver instead
To verify installation inside Domino Designer you need to open Help → About IBM Lotus Domino Designer menu, click Plug-in Details button,sort by Plug-in Id and check if you have these:
Leverages JDBC to connect to the relational databases- Accesses any database with a JDBC driver available
- The data is accessed directly: no synchronization needed with NSF
● Connections currently could be defined only within NSF
-
A NSF contains a new file design element (with .jdbc extension) for defining database specific connections. Such design element editingrequires switch to Navigator view currently and is located inWebContent/WEB-INF/jdbc directory.
● Global connections definition on server will be addressed later
● Uses a connection pool to optimize the use of connections
- Simple connection pool provided, plan to add support of Apache DBCP
There are 2 new data sources you could easily make to be used byyour xp:viewPanel control:
- JDBC Query data source, which provides Read Only access for RDBMS
- JDBC RowSet data source (uses the standard CachedRowSetImpl),which allows you to edit (create/update/delete) RDBMS data
● Access to different RDBMS table's fields is made through used for Domino views xp:viewColumn controls thus making such usagetransparent for developer by hiding all details
● At this moment Domino Designer tooling for table definition retrievalfor easier column/field selection is under development and you mayneed to know ahead your table DDL to specify properly columnNameattribute of xp:viewColumn control
New data sources for RDBMS connectivity(parameterizing)
●
A data source can either point to a named connection or a JDBC URL- Named connections are heavily advised as they take advantage of a connection
pool, and they are easier to manage as they are centrally defined
• The JNDI prefix can be omitted in the name
- JDBC URL are for debugging purposes only
● The SQL statement can either be defined (or computed) from a data sourceproperty, or defined in a separate file design element (*.sql)
● Parameters, matching the '?' in the SQL query, are also defined at the datasource level. The order of the parameters must match the order of '?' in the
SQL query
sqlTable: a simple table namesqlQuery: a general sql querysqlFile: points to a .sql design element
In XPagesJDBC.nsf demo application you'll find sample of CRUDprovided (XPage called JDBC_RowSetDatasource.xsp) throughwhich you could create/update/delete records in external RDBMS
To configure your DB2 connection you need to create new designelement (let's call it db2demo.jdbc) and specify in it JDBC driver classto be used, database name and user's credentials: