In our Batch project we run a shell script,which in turn invokes a web service.Our requirement is to run a select query on a DB 2 Database and fetch say 1000 A_TYPE accounts,then we will have to use these accounts to get a list of other accounts(A_TYPE,B_TYPE collumns) by using A_TYPE accounts in a prepared statement from a ORACLE DB.
The problem is that for every 1000 A_TYPE accounts i have to prepare the statement 1000 times and execute it 1000 times to get the B_TYPE accounts.It is time taking and not so efficient.
So if someone could suggest me a way to pass a list or array of A_TYPE accounts and then get a list or hashmap of A_TYPE,B_TYPE accounts so that i can use them further,it would be very helpful. Also i have to update my Db2 DB with the B_TYPE accounts in the place of A_TYPE accounts. All my logic is written in web service operation(JAVA) itself.
UPDATE:
Yes i am directly accessing the DBs through JNDI names.In webservice handler logic i ll make a call to both the DB's.I donot know the DB2 version used since i access it using JNDI name,Oracle is 10 g.i have queries like
SELECT A_TYPE account from ADB2 TABLE based on conditions (?,?) FETCH 1000 records only"` and `SELECT A_TYPE_Account,B_TYPE_Account from ORACLE_TABLE where A_TYPE_Account='?(A_TYPE)'
No i dont have to worry about transactions.i dont have idea of host variables and DB2 Dynamic query.