|
I am replying to topics 5 & 7: Here is a create procedure statement and the important snippits of the RPGLE code.. Hope this helps! Create Stored Procedure Statement: ************************************************************************************************** CREATE PROCEDURE library/procedure( IN parm1 CHAR ( 9999), IN parm2 INT, IN parm3 CHAR ( 10), IN parm4 CHAR ( 10), IN parm5 CHAR ( 10)) RESULT SETS 1 LANGUAGE RPGLE NOT DETERMINISTIC READS SQL DATA CALLED ON NULL INPUT EXTERNAL NAME programlibrary/program PARAMETER STYLE GENERAL ************************************************************************************************** Important snippits of RPGLE Program: ************************************************************************************************** 0010.00 * Program defined variables 0012.00 0013.00 D @parm1 S 9999 0014.00 D @parm2 S 15S 0 0015.00 D @parm3 S 10A 0016.00 D @parm4 S 10A 0017.00 D @parm5 S 10A 0018.00 D c1 S * 0019.00 0020.00 C *entry plist 0021.00 C parm @parm1 0022.00 C parm @parm2 0023.00 C parm @parm3 0024.00 C parm @parm4 0025.00 C parm @parm5 0026.00 C parm c1 0027.00 0033.00 0034.00 * Exit program 0037.00 C eval *inlr = *ON 0038.00 C endif 0039.00 0040.00 C return 0041.00 0053.00 0058.00 C/EXEC SQL 0059.00 C+ DECLARE c1 SCROLL CURSOR 0060.00 C/END-EXEC 0061.00 0066.00 C/EXEC SQL 0067.00 C+ OPEN c1 0068.00 C/END-EXEC 0069.00 0070.00 * Set cursor for result set 0071.00 C/EXEC SQL 0072.00 C+ SET RESULT SETS CURSOR c1 0073.00 C/END-EXEC 0074.00 ****************** End of data ******************************** ************************************************************************************************** java400-l-request@mi drange.com To: java400-l@midrange.com Sent by: cc: java400-l-admin@midr Subject: JAVA400-L digest, Vol 1 #270 - 7 ange.com msgs 04/03/2002 12:01 PM Please respond to java400-l Send JAVA400-L mailing list submissions to java400-l@midrange.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.midrange.com/cgi-bin/listinfo/java400-l or, via email, send a message with subject or body 'help' to java400-l-request@midrange.com You can reach the person managing the list at java400-l-admin@midrange.com When replying, please edit your Subject line so it is more specific than "Re: Contents of JAVA400-L digest..." Today's Topics: 1. Re: Server Jobs (Dave Wall) 2. Re: Server Jobs (David Morris) 3. Re: JDK 1.4??? (bdietz@3x.com) 4. Re: Submit a RUNJVA job with different userID (Dave Wall) 5. JDBC CallableStatement and SQL Procedure example (Geert Van Landeghem) 6. Re: WebFacing: Is this really Heaven? NO, it's hell!!!! (P.Goovaerts@Clipper.Be) 7. Re: JDBC CallableStatement and SQL Procedure example (Richard Dettinger) --__--__-- Message: 1 Subject: Re: Server Jobs To: java400-l@midrange.com From: "Dave Wall" <dawall@us.ibm.com> Date: Tue, 2 Apr 2002 13:19:24 -0600 Reply-To: java400-l@midrange.com My personal opinion is it comes down to skills and platform independence. If this application will run only to the iSeries and you do not have JDBC skills then command call is the way to go. In your case CC will probably be faster and easier to learn. If you need (or will need in a 'short' amount of time) this application to run to multiple types of servers then it is worth the time to do JDBC and use stored procedures. One other thought, be careful if you use connection pooling. Most connection pooling implementations are refined only to the user level. Your application is different because it needs job-level refinement. Suppose you have 10 connections for a specific user in the pool. Each connection probably represents a different job on the server. If you do work on a connection, put the connection back to the pool, then retrieve a connection to do more work, the odds are small that you will get the same connection you retrieve the first time. You have "a" connection for that user, but you don't have "the" connection. You will have a different job so work previously done on the connection does not show up. David Wall Toolbox for Java iSeries ODBC Driver for Linux "David Morris" <David.Morris@plu To: <java400-l@midrange.com> mcreek.com> cc: Sent by: Subject: Re: Server Jobs java400-l-admin@m idrange.com 04/02/2002 10:28 AM Please respond to java400-l David, Not too late at all, I am still experimenting. I am working on a native version of Ant for the iSeries. I really don't know how many or what commands to expect. I have a wrapper that could do setup and cleanup. As far as abnormal ends, etc. I can register a cleanup exit program and/or use a scope message at the job level if necessary. A timeout is reasonable, and could be configurable in the design that I have. Right now, I am concentrating on the tasks necessary to compile from CVS. The CRTRPGMOD command threw a curve because it will not run in a multi-threaded environment. I am having a hard time deciding whether Lo's suggestion to use JDBC is worth pursuing. I already have a server built that can run commands but it is geared toward CL and RPG. I could extend that to integrate better with Java. What would you suggest for running the commands? I can use CommandCall or right now I have the code set up to use a CallableStatement. That is just what I have tried. The command call seems to work well because of the message support, but that doesn't mean that CallableStatement or ? could not do the same thing. Thanks, David Morris >>> dawall@us.ibm.com 04/02/02 08:14 AM >>> One question (sorry this is late but just got back from vacation) -- how far apart are your commands? Each AS400 object represents a connection to a single server job. As long as the connection stays up all commands will be handled by the same job. So, a set of commands run through the same AS400 object will run in the same job as long as the connection does not drop between commands. Using the same AS400 object may not be practical if there is a lot of time between commands, but it should work for commands that are close (especially of the connection is reliable). David Wall Toolbox for Java iSeries ODBC Driver for Linux "David Morris" <David.Morris@plu To: <java400-l@midrange.com> mcreek.com> cc: Sent by: Subject: Server Jobs java400-l-admin@m idrange.com 04/01/2002 11:15 AM Please respond to java400-l Group, I have a Java program that needs a specialized environment to run several CL commands. If I use the CommandCall class, I get a new job for each command. I could submit my own server that processes these commands and then end it when I am done, but this seems like it would be such a common task, I thought I would check to see if I missed it in the toolbox or if anyone else has tackled this. The command call class works very well for what I am doing except that I cannot reconnect to the same server. One solution I am thinking about is a submitting a job that sits on a data queue waiting for commands and returning messages and completion status of each command. Thanks, David Morris _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. --__--__-- Message: 2 Date: Tue, 02 Apr 2002 13:12:18 -0700 From: "David Morris" <David.Morris@plumcreek.com> To: <java400-l@midrange.com> Subject: Re: Server Jobs Reply-To: java400-l@midrange.com David, Thanks for the helpful advice. I have used JDBC quite a bit for while developing our intranet applications. We used procedure calls extensively, but passed messages back through the SQLCA. If JDBC is involved, a file might be a good way to pass back messages. I am not sure how I retrieve them though. These would be diagnotic messages sent from things like CPY, CRTRPGMOD, CRTJVAPGM, etc. The tasks I am working on are all iSeries-specific. The non-specific stuff is what I am building on. On our system, our pooling is currently at the session level because we wanted to track users. I recently completed work to allow a global pool by swapping profiles or changing effective user and/or groups. In this case, the environment is very important. A build may need a library, qtemp, or something else along those lines. Thanks for your suggestions, I will start experimenting. David Morris >>> dawall@us.ibm.com 04/02/02 12:20 PM >>> My personal opinion is it comes down to skills and platform independence. If this application will run only to the iSeries and you do not have JDBC skills then command call is the way to go. In your case CC will probably be faster and easier to learn. If you need (or will need in a 'short' amount of time) this application to run to multiple types of servers then it is worth the time to do JDBC and use stored procedures. One other thought, be careful if you use connection pooling. Most connection pooling implementations are refined only to the user level. Your application is different because it needs job-level refinement. Suppose you have 10 connections for a specific user in the pool. Each connection probably represents a different job on the server. If you do work on a connection, put the connection back to the pool, then retrieve a connection to do more work, the odds are small that you will get the same connection you retrieve the first time. You have "a" connection for that user, but you don't have "the" connection. You will have a different job so work previously done on the connection does not show up. David Wall Toolbox for Java iSeries ODBC Driver for Linux --__--__-- Message: 3 To: java400-l@midrange.com Subject: Re: JDK 1.4??? From: bdietz@3x.com Date: Tue, 2 Apr 2002 17:08:11 -0500 Reply-To: java400-l@midrange.com Mike, not sure I just ran across the PTF and passed along the info. ------------------------- Bryan Dietz 3X Corporation -------------------------- Does the default Tomcat server (3.2.x) work with the new JDK? And what about websphere? On Mon, 01 April 2002, bdietz@3x.com wrote: I saw PTF MF27438 for V5R1. The title: JVA-CMPL-UNPRED SUPPORT FOR JAVA 1.4 --__--__-- Message: 4 Subject: Re: Submit a RUNJVA job with different userID To: java400-l@midrange.com From: "Dave Wall" <dawall@us.ibm.com> Date: Tue, 2 Apr 2002 16:59:46 -0600 Reply-To: java400-l@midrange.com Did you get a reply? Here are a few thoughts. 1. To be secure the Toolbox classes will not connect to the server unless it has a valid userid and password. To be totally accurate, the server will not accept a connection unless the client supplies a userid and password. If the userid is disabled, or the password is expired, is *NONE or is wrong, the Toolbox cannot connect to the server. 2. As a convenience when running on the iSeries, the Toolbox can use the userid and password of the job's current thread instead of having them supplied by the application. This does not, however, override the first consideration. If the thread's password is *NONE or expired, the connection will not work. 3. Starting with V5R1, the Toolbox can avoid the server and directly carry out the request in the current job on the current thread. The identity of the thread is used so no further authentication is needed. In your case option 3 may work. If you create an AS400 using the default c'tor and indicate the command is thread safe, the command server will be skipped and the command will be carried out using the thread's identity. For example, AS400 system = new AS400(); CommandCall cc = new CommandCall(system); cc.setThreadSafe(true); cc.run("myCommand"); (1) You must not specify a user profile when creating the AS400 object. If you specify a profile the Toolbox will do authentication. (2) The command must be tagged thread safe. If not, the Toolbox assumes the command is not thread safe and will use the command server (a single-threaded job) to run it. (3) Don't do system.connectService(). This will force a connection to the server. Just run the command. Hope this helps, David Wall Toolbox for Java iSeries ODBC Driver for Linux Attila_Halasz@qui xtar.com To: JAVA400-L@midrange.com Sent by: cc: java400-l-admin@m Subject: Submit a RUNJVA job with different userID idrange.com 03/28/2002 09:26 AM Please respond to java400-l Hello, we are developing a Java batch process on the AS400, which is reading XML messages from MQSeries, calls existing RPG programs to process the request and submits the response XML message back to MQSeries. Due security reasons the Java process has to run with a specific userID. This userID can not signon to the system, it is only used to run different batch processes. ( this user is specified on SBMJOB command). By doing so, we are receiving java.io.Exception. Is there a way to allow the JAVA program to have the capability to call AS/400 RPG programs without logging on to the system? Here is the JAVA code used to connect to the AS/400: String as400Name = "MyAS400"; as400 = new AS400(as400Name); as400.connectService(AS400.COMMAND); Here is the log from our JAVA job: java.io.IOException com/ibm/as400/access/SocketContainerUnix.getSubstPassword([B[B)[B+8 (SocketContainerUnix.java:97) com/ibm/as400/access/CurrentUser.getUserInfo([B[B)[B+16 (CurrentUser.java:73) com/ibm/as400/access/AS400ImplRemote.getPassword([B[B)[B+34 (AS400ImplRemote.java:918) com/ibm/as400/access/AS400ImplRemote.getConnection(IZ)Lcom/ibm/as400/access/AS400Server; 267 (AS400ImplRemote.java:859) com/ibm/as400/access/AS400ImplRemote.connect(I)V+13 (AS400ImplRemote.java:342) com/ibm/as400/access/AS400.connectService(I)V+87 (AS400.java:703) com/quixtar/oms/si/NMN8UPR.initialise(Ljava/util/Properties;)Z+0 (NMN8UPR.java:112) com/quixtar/oms/si/MQThread.<init>(Lcom/quixtar/oms/si/MQJob;I)V+0 (MQThread.java:16) com/quixtar/oms/si/MQJob.<init>([Ljava/lang/String;)V+0 (MQJob.java:74) com/quixtar/oms/si/MQJob.main([Ljava/lang/String;)V+0 (MQJob.java:36) Thanks, Attila _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. --__--__-- Message: 5 From: Geert Van Landeghem <gvl@reynderseti.be> To: java400-l@midrange.com Subject: JDBC CallableStatement and SQL Procedure example Date: Wed, 3 Apr 2002 11:51:22 +0100 Reply-To: java400-l@midrange.com Hello all, I'm looking for an example of an SQL procedure (written in RPG) that returns 1 or more ResultSets being used in a java program. I'm wondering if this is possible... Kind regards, Geert Van Landeghem Reynders Etiketten N.V * +32-(0)3/460.32.81 * +32-(0)3/455.18.83 M +32-0477/75.95.33 * gvl@reynderseti.be --__--__-- Message: 6 To: java400-l@midrange.com Subject: Re: WebFacing: Is this really Heaven? NO, it's hell!!!! From: P.Goovaerts@Clipper.Be Date: Wed, 3 Apr 2002 14:26:50 +0100 Reply-To: java400-l@midrange.com This is a multipart message in MIME format. -- [ Picked text/plain from multipart/alternative ] Hi, again... Had to stick with my first impression! It looks very nice, but again, unusable in practice ! despite 1) IBM is saying WebFacing can be used to go on the Internet very fast with none or minor codechanges 2) IBM-ers telling us it is able to have responsetimes of 1second max. 3) Our system should have enough CPW (processor =3D 420 - interactive feature =3D 120) 4) IBM's helpdesk efforts to help us 5) Applying ptf's, cumpacks, servicepacks 6) loading SP5 7) neverending patience of myself (though it's running at the end after 2 months) I feel bad to admitt that we cannot use WebFacing for WebAccess. Yes, it's running on 'one' PC's in our Intranet Environment (response 3seconds max) but I thought it was written to go 'online on the Internet' very fast without changing any code???? (btw, other PC's (Intel Celeron800) give response of 10secs max.) - We still have response between 20 to 25 seconds for each page to load... - We still get zStyles - errors... - We still don't know where the 'sign' command/object comes from, it gives an error in the joblogs of the WF-sessions after completing... - We even cannot export projects anymore! After applying SP5, we cannot export projects anymore. Folders are generated, filenames are found but all with a length of zero bytes... When we copy the files manually from the 'PC drive' to WebSphere it works normally... I'm pretty sure we could have created some webapp's using Frontpage / Visual Caf=E9 in stead of trying to use WebFacing... Then we could drink o = n some success in stead of going drunk because of the bad experiences... Patrick Goovaerts ICT/Clipper Support nv http://www.conti7.be "Patrick Goovaerts" <pgoovaerts@pandora.be> schreef in bericht news:a2788g $= 110i$1@news.boulder.ibm.com... > Hi, All web- and javaguru's. > > My first impression of WebFacing (Brussels, may/june 2001) was: > > "Looks good, but first see this in action. Have seen some promissing > projects before..." > > So, I went on learning WebDevelopment with all around it (WAS, HTML, VAJAVA, > STUDIO, JSP's, Servlets) which, for the obvious reasons, took a long time. > Not all companies can afford to have 1 specialist for each of the parts of > web-development. Or am I wrong here? We managed to created some simple > Client-Server apps, using Swing. Also a simple web-application (view of > records from AS400 using DPC) and a more intensive one which let a user > create, delete, update, view, copy,... records straight into our AS400 using > JDBC and SQL. Although the latter is still in test and has to be fine-tuned. > And now, our 2002 present from our ITC-manager arrived: V5R1M0 for the AS400 > and an updated WDT400 V5.1 with WebFacing. > > After installing the new releases, I could see this 'Masterpiece' in action. > Yes, 'Masterpiece', I have no other words for 'WebFacing'! I took a running > application which consist of 5 modules (about 10 panels) and loaded it in > WebFacing. Convertion only show 2 serious problems (indicators in dspf on 1 > line) and placed the app in IBM WebSphere 3.5.2 > > Result: Complete web-application created in 15 minutes! (after cutting of > the time to overcome firsttime-usage problems). > > With a basic knowledge of WebApplication Development one could create > WebApplications, based on running business-applications without changing > business code! Yes! It's really true! > > What are the Pitfall's? > Are there any? > Is there a dark side? > Am I wrong here? > Maybe I'm a little too over-excited, because of the stress of learning and > solving webdevelopment problems last year? > I want too here it from you guy's... > > Patrick Goovaerts --__--__-- Message: 7 Subject: Re: JDBC CallableStatement and SQL Procedure example To: java400-l@midrange.com From: "Richard Dettinger" <cujo@us.ibm.com> Date: Wed, 3 Apr 2002 10:34:42 -0600 Reply-To: java400-l@midrange.com "I'm looking for an example of an SQL procedure (written in RPG) that returns 1 or more ResultSets being used in a java program. I'm wondering if this is possible..." I could really use this too... I don't need the Java program to use it, as long as someone gives me the create procedure information so that I can get the stored procedure created. I'd like to use this information in helping people with an RPG background and code base understand how to build stored procedures that they can leverage in their Java programs. If someone with a background in RPG could help this Java programmer out, I'd be very grateful. Richard D. Dettinger iSeries Java Data Access Team Democracy's enemies have always underestimated the courage of the American people. It was true at Concord Bridge. It was true at Pearl Harbor. And it was true today. Rochester Post-Bulletin Tuesday September 11, 2001 --__--__-- _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) digest list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. End of JAVA400-L Digest
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.