Author |
Message
|
sreemoyee.b |
Posted: Thu Jul 30, 2009 1:31 am Post subject: IBM iSeries Access driver if compatible with Message Broker |
|
|
Newbie
Joined: 20 Jul 2009 Posts: 6
|
Hi all,
I have to call a stored procedure from an AS400 system from my message broker toolkit. Could anybody please suggest what drivers I should use..
As I am getting only the system details (Box name, IP Address, Port Number, UserID and password) , not the Database alias name or any database related info, it is not being possible for us to connect to the system with the IBM DB2 ODBC driver (that comes with the Broker database itself).
Do I need an IBM iSeries Access ODBC Driver.. I got this option from net.. Butam not sure if I can connect to AS400 with this driver from Message Broker.
Or else, (by googling) what I found is : if I have IBM DB2 Connect setup, then also I can connect to AS400.. In that case, what driver I should use..
As am very new to this field, am not able to understand d approach I should take.. need some kind of help ASAP..
Thank u in advance.. |
|
Back to top |
|
 |
AkankshA |
Posted: Thu Jul 30, 2009 1:42 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
Is the remote database in which the stored procedure resides a DB2 database or of some other make ? _________________ Cheers |
|
Back to top |
|
 |
Maximreality |
Posted: Thu Jul 30, 2009 3:23 am Post subject: Re: IBM iSeries Access driver if compatible with Message Bro |
|
|
 Acolyte
Joined: 04 Jun 2004 Posts: 65 Location: Copenhagen
|
Try installing DB2 control center on your laptop, then you should be able to discover DB2 databases on your network
Then you should find information for setting up your ODBC connection
/Rasmus |
|
Back to top |
|
 |
zpat |
Posted: Thu Jul 30, 2009 3:29 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
This is what IBM told me about a similar question:
Quote: |
The broker makes connections via ODBC and, in the case of DB2, the ODBC driver always connects to the database, be it local or remote, via the DB2 client.
So, first a DB2 client definition (i.e. an 'alias') for the remote database must be made and then an ODBC definition made which points to the database alias.
There is no charge required for client interconnection amongst distributed platforms (UNIX, Linux, Windows) but IBM charges for, and enforces by license, connections from distributed client to host databases, i.e. DB2 servers on zOS or iSeries. Up to DB2 v8.2 this host connection functionality was provided by the DB2 Connect product. From DB2 9, the clients were re-architected to be capable of host connection but a chargeable license is still required to use it to connect to host databases.
In summary, DB2 Connect function and license is required only if connecting from distributed broker to a host database; distributed broker to distributed DB2 works out of the box for no additional charge." |
|
|
Back to top |
|
 |
sreemoyee.b |
Posted: Thu Jul 30, 2009 6:15 am Post subject: |
|
|
Newbie
Joined: 20 Jul 2009 Posts: 6
|
The stored procedure is in the AS400 box. It is a DB2/400 system. (V5R4). Thatz all info we have about the database.
With DB2 for i5/OS driver I am able to connect to the system. I can see the procedure also.. but how can i call that stored procedure from ESQL code? I dont have any Data Source for that.. Can I use Java Compute node for calling with JDBC driver? In that case, What code should I write inside? Do i need any IBM DB2 connect setup for that? |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 31, 2009 12:44 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Use an ODBC connection from a Compute node. |
|
Back to top |
|
 |
sreemoyee.b |
Posted: Fri Jul 31, 2009 2:16 am Post subject: |
|
|
Newbie
Joined: 20 Jul 2009 Posts: 6
|
IBM DB2 ODBC driver is not working (as for creating the DSN we need to have the DATABASE NAME or ALIAS)..
Should I use iSeries Access ODBC driver for connecting? Would it work/? |
|
Back to top |
|
 |
zpat |
Posted: Fri Jul 31, 2009 2:46 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Get DB2 connect working - don't look for ways around the basic issue here.
If it is documented as supported - make it work or call IBM for help. |
|
Back to top |
|
 |
christian82 |
Posted: Tue Aug 04, 2009 7:08 am Post subject: |
|
|
Newbie
Joined: 24 Jul 2009 Posts: 7
|
you could use jt400.jar from toolbox form java compute node like this:
String sql = "{call STALIBRP.STASPICR(?, ?, ?, ?, ?, ?)}";
String svrIP_as400 = "localhost";
String usuario_as400 = "user";
String clave_as400= "password";
String lib_as400="STALIBRP";
//enabling connection
AS400JDBCDataSource ids = new AS400JDBCDataSource(svrIP_as400);
ids.setUser(usuario_as400);
ids.setPassword(clave_as400);
ids.setLibraries(lib_as400);
CallableStatement stmt = ids.getConnection().prepareCall(sql);
//setting procedure params
stmt.setString(1, icrInput.getIdServicio());
stmt.setString(2, icrInput.getIdConsumidor());
stmt.setString(3, icrInput.getIdProveedor());
stmt.setString(6, icrInput.getCargaUtil());
stmt.registerOutParameter(4, Types.CHAR,icrOutput.getCodRespuesta());
stmt.registerOutParameter(5, Types.CHAR, icrOutput.getDesRespuesta());
stmt.registerOutParameter(6, Types.CHAR, icrInput.getCargaUtil());
stmt.setQueryTimeout((newInteger(1000)).intValue());
stmt.execute(); |
|
Back to top |
|
 |
|