5 pts.
 AS400 – ORACLE JDBC
Can we take an RPG program that reads a DB2/400 database table and without modifying its code change it to point to the “same” table in an Oracle database using JDBC?

Software/Hardware used:
ASKED: March 4, 2010  6:10 PM
UPDATED: November 28, 2011  9:20 AM

Answer Wiki:
Maybe (but I wouldn't bet on it). IF the SQL is all ANSI standard without any IBM extensions. IF the datatypes all match up properly (Oracle DATE vs DB2 DATE don't correspond). IF all names match (this is the easy one). The optimizers in the two different RDBMSes are most likely going to decide on different access paths, so watch out for that. ========================================================= I would actually bet against it. First likely issue would be having the Oracle database defined in the database directory. That would likely need DRDA connectivity which <i>I think</i> is available from Oracle though pricey. You might find an ARD that works elsewhere; you might write your own. And IF that could be made to work, you'd need to set the Oracle database as the default database on that system. I suspect that every other app would quickly find reason to complain about that. If Oracle as default DB won't fly (and I'm pretty sure it won't), it's unlikely that there is any SQL in your RPG that allows choosing the database to CONNECT to nor any spec for user/password. If you don't change the RPG, it's going to continue connecting to the default *LOCAL database. Unless your RPG is actually a front-end for JDBC access to your local DB2 database. Then maybe you do something at the Java level. But I'd be surprised. Tom
Last Wiki Answer Submitted:  March 11, 2010  12:49 am  by  Meandyou   5,205 pts.
All Answer Wiki Contributors:  Meandyou   5,205 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

… its not possible, but you could come rather close to it with Open Source solution ArdGate. Using ArdGate, you could use embedded SQL in RPG to access an Oracle, or any other JDBC capable database and ArdGate could run completely on AS/400. But there are some diffrences between accessing the local database and a remote database from RPG. You would have to connect, use commitment controll and there are some limitations for remote access compared to local access and ArdGate will add some additional restrictions too. But it would be possible to access an Oracle database in a very similar way as accessing the local DB2.

Dieter Bender
… there is an Open Source alternative solution available. Using ArdGate, you could access all JDBC databases direct from COBOL or RPG applications, using embedded SQL. Installation and configuration is done in less than a half day.

Dieter Bender

Access any Database from ADABAS to XBASE with embedded SQL in RPG. http://sourceforge.net/projects/appserver4rpg/

 40 pts.