I enjoy speaking at user groups mainly because I love showing people the cool programming tricks I've discovered. But even better than that is when I pick up a programming tip from one of the people I meet! On my recent trip to New Jersey, I met a man named Hugo Cantor, who gave me a tip.
There's an open-source (free) JDBC driver for Microsoft SQL Server that performs better than the one from Microsoft. And it not only works from Java, but it also works with my RPG support for JDBC drivers!
The name of the driver is jTDS, and its website claims ". . . currently the fastest production-ready JDBC driver for SQL Server and Sybase" and states that it supports the following databases:
I don't use SQL Server in my own shop, so I haven't had occasion to test these claims, but they sound pretty impressive, and they're backed up by Hugo Cantor's experience. He told me that it outperformed the Microsoft-supplied driver in his applications.
On the jTDS website, you'll find the download links and documentation.
To use jTDS with JDBCR4, download the code and put it in your CLASSPATH as you would for any other JDBC driver. Use the sample RPG code for Microsoft SQL Server but change the JDBC_ConnProp call to read as follows:
conn = JDBC_ConnProp('net.sourceforge.jtds.jdbc.Driver'
:'jdbc:jtds:sqlserver://myserver.example.com:1433'
: prop );
For Sybase:
conn = JDBC_ConnProp('net.sourceforge.jtds.jdbc.Driver'
:'jdbc:jtds:sybase://myserver.example.com:7100'
: prop );
The code for JDBCR4 itself doesn't need any changes to use this driver. However, if you need a copy of the JDBCR4 service program, you can find the latest version (at the time of this writing) here.
Thanks for the tip, Hugo!