ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » error when connectin to an AS400 DB from a Java compute node

Post new topic  Reply to topic
 error when connectin to an AS400 DB from a Java compute node « View previous topic :: View next topic » 
Author Message
sandhyarajcoomar
PostPosted: Wed Mar 27, 2013 12:43 am    Post subject: error when connectin to an AS400 DB from a Java compute node Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 27, 2013 2:34 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Did you use DB2 connect?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Mar 27, 2013 3:53 am    Post subject: Reply with quote

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
View user's profile Send private message
DSPS
PostPosted: Tue Apr 02, 2013 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » error when connectin to an AS400 DB from a Java compute node
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.