Don,
If you're having issues with Java and processing SQL Server data from RPG, want to remove Java from the mix entirely and are open to commercial options you might want to consider our RPG2SQL integrator software.
All the actual SQL processing happens on a Windows server using the actual Windows based database drivers so there's not a ton of memory contention in your application code. Then there's a service program that binds to your RPG code to talk to the Windows based server component.
Here's a link to a recent webinar I did and you can download a demo if interested.
Save 5 Hours a Day by Integrating RPG to Excel & SQL Server
http://www.helpsystems.com/rjs/events/recorded-webinars/save-5-hours-daily-data-integration
Regards,
Richard Schoen
Director of Document Management
e. richard.schoen@xxxxxxxxxxxxxxx
p. 952.486.6802
w. helpsystems.com
------------------------------
message: 2
date: Tue, 5 Jul 2016 16:35:12 -0500
from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
subject: Re: JDBCR4 calling repeatedly
Hi Don,
I moved this discussion. It was originally on Midrange-L, but as it's related to RPG, I thought RPG400-L would be a better choice.
1) Yes, of course you can put it in a procedure. (Why wouldn't you be able to? I don't know of anything that can't be put into a procedure -- assuming it's coded properly, of course.)
2) Yes, using a parameter marker is quicker (and safer, security-wise) than concatenating a value if you plan to run the statement more than once. Of course, a big part of how much difference this makes depends on how the database engine itself works. I'm not especially familiar with MS SQL Server -- but it sure couldn't hurt!
3) You would free the result set, but not the statement itself. Then change the parameter marker and run the statement again. Only free the statement after you're done with all of the times you plan to run it.
You might also consider looking at Dieter's ARDGATE tool as an alternative to JDBCR4. It lets you run the Java part of things in a Java Application Server which can improve performance, especially if you're running this in multiple jobs at the same time.
-SK
As an Amazon Associate we earn from qualifying purchases.