Hi everyone. I’m happy to announce a Video Tutorial where I explain how to integrate one’s XPages Application with DB2 directly, and not through back-end Forms and Views.
The trick here is to have a bit of JDBC understanding, as well as a basic understanding of Relational Databases and SQL Query.
To work with this Video Tutorial, you’ll need to have the following in place:
1. An installed version of DB2. This can be DB2 Express as well, which is free – Click here to download.
2. An installed version of Domino Designer 8.5.3. I tested everything on my Domino Server, but there’s no reason why this shouldn’t work using your local HTTP session for Domino Designer – Click here to download.
3. An UpdateSite to install OSGI Plugins on Domino Server. NOTE: The UpdateSite database gets used for Domino Servers, and will not work for your local environment. To test everything using your Local HTTP, you’ll need to install the OSGI Plugins manually. You do this by extracting the contents of the Plugins Zip File to the Notes Data Directory, under “domino/workspace/applications/eclipse” folder.
Click here to view the Tutorial on how to setup the UpdateSite database and deploy OSGI Plugins on your Domino Server.
4. With reference to point number 3, Install the XPages Extension Library and JDBC Driver Plugins.
Download XPages Extension Library
5. Once you’ve deployed your plugins to your Domino Server, you can type in the following Commands to check if the Plugins were installed properly:
XPages Extension Libary:
tell http osgi ss com.ibm.xsp.extlib
JDBC DB2 Plugin:
tell http osgi ss extlib.driver.db2
The Domino Server should return information relating to the plugins you installed.
6. Here’s a copy of the Code that needs to be added to the db2.jdbc file that I speak about in the Video
<jdbc>
<driver>com.ibm.db2.jcc.DB2Driver</driver>
<url>jdbc:db2://localhost:50000/TESTDEMO</url>
<user>db2admin</user>
<password>password123</password>
</jdbc>
7. Here’s a copy of the Code that I use in the Video to add/remove/update and delete data in DB2
var mydata = {
FIRST_NAME: “John”,
LAST_NAME: “Jardin”
}
@JdbcInsert(“db2″, “JJARDIN.USERPROFILES”, mydata)
var mydata = {
FIRST_NAME: “Sean”,
LAST_NAME: “Smith”
}
@JdbcUpdate(“db2″, “JJARDIN.USERPROFILES”, mydata, “ID=?”,1)
@JdbcDelete(“db2″,”JJARDIN.USERPROFILES”,”ID=?”,1)
I trust you will enjoy this Video. A Big thanks to David Leedy for making the video part of his NotesIn9 Series, and congrats once again on his recent milestone of 100 000 Views.
Also, another Big Thanks to the Domino and XPagees community, for always been available to assist wherever help is needed.
STAY TUNED FOR PART 2 OF XPAGES AND DB2 INTEGRATION!!!

Very easy in the right hands…
I have a project where we currently retrieve DB2 data via SQL calls and store it in our Notes database and was wondering if video 2 will show how to retrieve this same data using these new methods, but instead of storing it in the database just display it in the database.
Hi Dwain. Yes, part 2 will show how to use a JDBC Rowset Data Source to achieve this result. In one of my projects I store nothing in a Notes Database. Everything displayed in my views comes from DB2.
I will record part 2 in the next 2-3 weeks.
Cheers,
John
Hello John Jardin,
unfortunately the “JDBC DB2 Plugin” download is not available anymore and we are struggling to get that part working now(I am not experienced in this part of lotus notes).
Could you maybe mail the deleted file to me and/or change your tutorial for a noob like myself?
Thanks!
Peter
Hi Peter. I do apologize for replying to this quite late.
I see what you mean with the original driver plugin been removed. I have updated my Post to include a link to the driver via my public DropBox folder.
Below is the link as well.
Cheers
John
https://dl.dropbox.com/u/8908032/Extlib_8.5.3_DB2_Driver_updateSite201110201044.zip
Hello John,
thanks a lot everything works like a charm now, great tutorial! Im looking forward to the 2nd part =)
greetings from the Netherlands
Peter
That’s good news Peter.
Yes, I need to get Part 2 in place. I was a little concerned at the process of editing relational data, but I have a few cool ideas to make this work easily enough.
Stay tuned
Good night Mr Jhon, I am Andres Rodriguez, first of all I apologize for my English, I am new with Xpages and I am writing to ask you a great favor if you can tell me how to generate a link for a viewColumn dynamically, the context is the follows:
I am developing a web application in Lotus Domino 8.5.3 with XPages extension library, this application must connect to a database that is in DB2, all the information is there, from Domino I can connect to the database and I create a view that reads information from the database, now I need to do when I click on any of the rows in this view, I redirect to an XPage where is the form that i use to update the information of that row, for this I am trying to create a link dynamically to PageURL property of the ID column that is the one with the link function, and I got it, the code I use is this:
“?content=AND2_AlumForm_Admin”
to show the information that comes from the database in a view column, columname property must be configured with the same field name of DB2 database that I want to show in that column, the problem is that i dont know how to add in the above link a parameter that have de columnname value of the row on i do click, ie if row 3 contains the value 123 in column ID, the link would be something like:
“?content=AND2_AlumForm_Admin&vid=”+123
Mr. Jhon, I really appreciate any help you can give me
thanks
Hi Andres. I have good news. On Monday I will be publishing part 2 of Integrating XPages with DB2. In that video i show examples of how to retrieve column values and how to create links, etc.
I’m sure it will answer most if not all of your questions. Maybe after watching that video, you can let me know if you have any queries.
Many thanks
Mr. John thank you very much for responding and Monday I’ll be very aware of the video
thank you very much again
Hi Andres. As promised. Please check my latest Blog Post. I really hope it helps.
Cheers
http://localhost:22660/2012/09/18/tutorial-integrating-xpages-with-db2-part-2/
Hello John,
great tutorial.
In the data properties of the view panel I only have “Show data from: ” : Domino View.
I don´t have the option JDBC Query
Regards
Fernando
Hi Fernando. Thanks for your Comment.
Please check out the following:
1. Are you running Domino Designer version 8.5.3 or above?
2. Do you have the XPages Extension Library 8.5.3 Installed in your Domino Designer? (JDBC is new to 8.5.3)
3. In your Application Properties in Domino Designer, in the Advanced Tab (Last Tab), is the XPages Extension Library Selected (There should be 2 checks there if I’m not mistaken).
If you applied Step 3, make sure to re-build your Application.
Hope you come right. Cheers.