As of March 26th version 2.2 of InformixDB - the open source Python extension module for connecting Python applications to IBM Informix database engines - is available. New features include support for BOOLEAN types and improved support for DECIMAL and MONEY as well as various bug fixes.
For more information on how to use InformixDB check out the InformixDB manual, and the README.[Read More]
Administrating and Developing with Informix
RSS feeds provide a convenient way to display up to date information directly in your Firefox browser toolbar. I for one spend more time perusing the BBC News and Slashdot feeds than I should.
Implementing an RSS feed that displays database information is very simple, hence the 5 minute Informix RSS feeds..
These two examples, for JSP and PHP, display a summary of the last 20 orders from the IDS stores_demo database. They both use the following IDS 10.0 SQL query:
Five Minute JSP Informix RSS Feed
If you have a working Tomcat installation setting it up to work with Informix JDBC drivers is as simple as copying the JDBC jar files into $CATALINA_HOME/common/lib and restarting.
Customize the machine, Informix Server and links in this code and create a new Tomcat webapp. The resulting URL can be added to the Firefox toolbar as a Live Bookmark.
Five Minute PHP Informix RSS Feed
Here's the equivalent code in PHP. This example uses the Informix PDO Driver.
This should result in the same output as the JSP example.
The look of the XML output when viewed from a browser can be improved by using an XSL stylesheet, and various parameters such as refresh interval (TTL) can be tweaked. There are some good RSS tutorials and books available, or it can be fun to reverse engineer the stylesheet of your favourite news feed to see what they do.[Read More]
If you've ever used dbaccess on Windows and have your Command prompt screen buffer height set to greater than the old default of 25 lines, you've probably seen the screen buffer corrupted after exiting from dbaccess. A typical symptom is getting a directory listing by running 'dir' and seeing the listing obscured by fragments of earlier screen output.
I'm pleased to report this problem is finally resolved, with the fix of product defect 175362:
DBACCESS CORRUPTS CONSOLE BUFFER WHEN EXITING ON WINDOWS
With the fix in place, the screen buffer is saved when dbaccess is started, and correctly restored upon exit. Look for this in the next IDS interim version, 10.00.TC5, or for those who can't wait, the fix is already available in the 10.00.TC4W2 post-interim drop.
So, you might be wondering, when is IBM going to offer a fully featured interactive GUI SQL editor for Informix?
There are some interesting projects currently underway in this area, I hope to provide more updates soon.[Read More]
Firstly, welcome to the Informix Application Development blog coming to you from rainy Beaverton, Oregon. I plan to use this blog mainly for Informix application development technical notes and tips, and anything else pertaining to Informix that crosses my mind.
I needed to set up a connection pool for a JSP application using Tomcat 5.5 and the Informix 3.0 JDBC driver recently and had a hard time finding any Informix specific instructions, so thought I might aswell start with that..
Since connection is an expensive part of a JDBC application it makes sense to maintain a connection pool, particularly for simple applications which connect/disconnect each time the page is viewed. Tomcat 5.5 comes with the Jakarta Commons Database Connection Pool implementation built-in so configuring a connection pool to work with any JDBC driver is fairly straightforward, and can be divided into 3 steps. In the following notes $CATALINA_HOME is assumed to be the path where you installed Tomcat, the application under webapps is called jspdemo, the INFORMIXSERVER is ol_myserver on mymachine:
1. Add a Context entry to conf/server.xml.
The Context entry goes in server.xml before the end of the Host definition </Host>. Add a Context entry for each connection URL required.
Edit $CATALINA_HOME/conf/server.xml and add:
Read the Tomcat documentation for more information on the resource parameters such as maxActive and maxIdle.
2. Add a Resource reference to WEB-INF/web.xml.
If the application directory is jspdemo, the web.xml file will be:
$CATALINA_HOME/webapps/jspdemo/WEB-INF/web.xml - If you don't have one a Tomcat tutorial should guide you through creating a basic one. Before the </web-app> tag add the following:
Note the res-ref-name is the same as the Resource name defined in server.xml.
3. Modify the JSP application to get the Connection from the connection pool.
Add javax.naming.*,javax.sql.* to your JSP page import tag.
Replace the old
Connection conn = ...with:
Restart Tomcat to re-read the server.xml settings and the connection pool should be operational. After a few connections run onstat -u at the database server to see the pooled sessions.