Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running AS/400 Program Remotely Connection gets Hang!

Posted on 2008-06-16
4
Medium Priority
?
293 Views
Last Modified: 2008-09-30
Hi Experts!
I am using jsp  to connect DB2 Universal database for iseries, but my application is hanging while trying to connect to the 400. No exception is returned - it just sits there. I have no real knowledge of the 400 side of things so I don't know how to log user activity to see what is going wrong or anything.

I have checked with debugging on the line connection1 = d.connect(o,p,"xxxxx"); it gets hanged. please help me out of this problem.


Connection connection1 = null;
		 
		
	     AS400JDBCDriver d = new AS400JDBCDriver();
	     Properties p = new Properties();
	
	     AS400 o = new AS400("HOSTSEVRENAME");
	
	     p.put("user", "USERNAME");
	     p.put("password", "PASSWORD");
	     try
	     {
	    	 connection1 = d.connect(o,p,"LIB");
//on this line the application gets hang
 
	     }
	     catch(SQLException sr)
	     {
	    	 try
	    	 {
	    		 connection1.close();
	    	 }
	         catch(Exception e)
	         {
	        	 response.sendRedirect(response.encodeRedirectURL("login.jsp?action=efailed_" + e.getMessage()));
	         }
	         response.sendRedirect(response.encodeRedirectURL("login.jsp?action=srfailed_" + sr.getMessage()));
	     }

Open in new window

0
Comment
Question by:vikasbapat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 2000 total points
ID: 21801260
Hi Vikasbapat,

Did you include the jar files util400.jar and jt400.jar? You need them both.
What will you do with the "LIB" in the connect? using the library list require "*LIBL"

If we don't get more info, we can't really help more I think, but in the mean time, check these examples,
I think it will help you a lot.

http://www.code400.com/viewsamples.php?lang_id=19

Regards,
Murph

0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 21802259
are you sure that the session can be made on the network ? maybe some ports are blocked
what do you mean by hang? when does it unhang and what message do you receive?
0

Featured Post

Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question