|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
error when connectin to an AS400 DB from a Java compute node |
« View previous topic :: View next topic » |
Author |
Message
|
sandhyarajcoomar |
Posted: Wed Mar 27, 2013 12:43 am Post subject: error when connectin to an AS400 DB from a Java compute node |
|
|
Newbie
Joined: 27 Mar 2013 Posts: 1
|
Hello..I'm trying to connect to an AS400 db From a Java compute nodebut getting errors.Can u plz advise.
My testing scenario is :
1. My broker flow is triggered every 9secs to run a select and delete row in AS400 DB
2. Connect to AS400 DB using JDBC_TransactionType.MB_TRANSACTION_AUTO.
try {
//get connection to the AS400 server
if (conn == null)
try { conn = getJDBCType4Connection("AS400db",JDBC_TransactionType.MB_TRANSACTION_AUTO);
strSelectStoredProcName = (String)getUserDefinedAttribute("SelectStoredProcName");
result = new CoreSelectCustomerDetails().retrievePPWICustomerDetails(conn, strSelectStoredProcName);
} catch (SQLException e) {
//store any error code and description in the environment tree.
mbElement.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "ErrorCode", ErrorCodes.C0001.toString());
mbElement.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "ErrorDesc",ErrorCodes.C0001.getErrorDescription());
catchTerminal.propagate(assembly);
3. Get rows from ResultSet once and get right results - OK
4. Delete all rows from the table using rs.DeleterOW, meaning that the ResultSet should return nothing next time.
5.Try fetching again (now it should return 0 rows) .BUT it returns the exact same rows as in step 3, even though the database table is empty.
6. If I restart the broker flow it works fine again.
Now if I change the code as follows :
try {
//get connection to the AS400 server
if (conn == null)
{
conn = getJDBCType4Connection("AS400db",JDBC_TransactionType.MB_TRANSACTION_AUTO);
}
try {
strSelectStoredProcName = (String)getUserDefinedAttribute("SelectStoredProcName");
result = new CoreSelectCustomerDetails().retrievePPWICustomerDetails(conn, strSelectStoredProcName);
} catch (SQLException e) {
//store any error code and description in the environment tree.
ErrorCodes.C0001.toString());
mbElement.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "ErrorDesc", ErrorCodes.C0001.getErrorDescription());
catchTerminal.propagate(assembly);
I get an error : java.sql.sqlexception the connection does not exist |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 27, 2013 2:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you use DB2 connect?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 27, 2013 3:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
So you've described at least two entirely separate issues, if not more.
Which one, precisely, would you like assistance with? |
|
Back to top |
|
 |
DSPS |
Posted: Tue Apr 02, 2013 7:23 am Post subject: |
|
|
 Apprentice
Joined: 11 Sep 2008 Posts: 44 Location: Southern England
|
I don't know, is there an explicit commit step that has to be called to update the database table, rather than just start a transaction to delete the rows?
I really don't know, but that's what I'd be looking at in the circumstances having worked in Encina/TX Series. _________________ Distributed Systems Professional Services
WebSphere and MQ Consulting and Training |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|