views:

718

answers:

5

Does anyone have links and resources to connect to an AS400 from Java?

I remember years ago, somebody told me about a connector that simulates KeyStrokes from the keyboard and other "purest" approach that connected directly.

On the web I have found a lot of links, but I cannot find a complete product to do this (I am probably not using the right keywords).

EDIT

Thanks for the answers:

What we are looking for is a way to access the data inside the AS400 and/or the screens it uses and expose them for other new applications re-use. Either as a webservice of some sort, or directly through Java ( and java will expose the operations using webservices )

Thanks in advance.

EDIT

As per MicSim post, I've also found this link:

http://www.ibm.com/developerworks/library/ws-as400/index.html

A: 

This obviously depends on what you want to do, however if you want to simulate keystrokes across a network connection to an AS400 process then Expect4j may be the library you are looking for.

This is generally a really nasty hack though and there are frequently better ways to achieve your goals. What are you trying to do?

The expect4J library can be found here. Expect was originally a unix command that allowed you to specify a string that you are expecting to see and then a string of characters to return. It was frequently used for automating logins etc and for screen-scraping applications.

Steve Weet
I'm looking for a way to access AS400 and retrieve data. About the keystroke, what I heard was more like a library that capture the greenscreens and provide input/output for them. I don't remember the name of the library
OscarRyz
The Expect library looks for particular strings and then sends specific responses and would certainly do what you want.
Steve Weet
+8  A: 

What you are looking for is probably the Toolbox for Java™ & JTOpen from IBM. There is also an AS400 class in the toolbox for performing specific AS400 tasks. You can look here and here for more details. Just googled it and hope it's helpful.

MicSim
Use ProgramCall to call PGM's, CommandCall to call CMD's. If you need to do screen scraping I _believe_ I've heard that the tn5250j project may allow you to peek at a session.
Thorbjørn Ravn Andersen
A: 

If you just want to run Java on the AS/400 (or iSeries, or System i, or whatever IBM's marketing department has decided to call it this month), that's a supported language. You can access the pseudo-DB2 database directly. Or are you after some other form of integration?

Pontus Gagge
More in the way to expose a legacy AS400 system and expose it to webservices of some sort. Or probably directly to java. Not really using it as a target platform
OscarRyz
+2  A: 

IBM's 5250 screen-scraping technology was "WebFacing" - I would post a link but you're probably better off Googling it, since IBM's documentation is so scattered. There are other technologies available too but: Screen-scraping was never anyone's favourite since typically you end up with something which, although it looks more up-to-date, actually is harder to use than a green screen and no more functional. The 5250 is probably the single best data entry platform I've ever used - web forms in a browser are one of the worst.

As mentioned, jt400 is the way to go for most other things. In particular:

JDBC - for all things SQL. If you do it right and address your files as though they really are tables, it's a way to get away from the 400 entirely.

Record-level access - write Java programs using a similar database API to RPGLE (all those chains, setlls that 400 programmers love)

Call programs, system commands, manage resources (data queues, data areas, prints / spools, jobs etc etc)

Good luck

jjujuma
A: 

jacada makes tools to do what your looking for

http://www.jacada.com/