How can I access a file in QTEMP library (using Java) knowing that the temporary file was created before the execution...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
of the Java class? Web development expert Jim Mason explains.
Let the job create the QTEMP file normally. Use a simple JDBC access to read or write to the file in QTEMP.
JDBC is dynamic and can pick up newly generated tables. Use the JDBC driver in the Java toolkit for testing for example.
It is in the jt400.jar file IBM distributes with the toolkit on the iSeries. Check for program 5722-WDS or 5769-JC1 installed on your iSeries. A typical URL for the toolkit driver might look like:
String URL = "jdbc:as400:myserver/Qtemp";
A select statement string like:
String SQL = "SELECT * FROM MYTABLE";
For my, see the JDBC Faqs in the Java toolkit. You could also use the local iSeries JDBC driver if the application runs on the iSeries server.
MORE INFORMATION ON THIS TOPIC
Ask your Web development questions--or help out your peers by answering them--in our live discussion forums.
The Best Web Links: tips, tutorials and more.
Check out this live Q&A with Dave Slater and Jim Mason, How to best get started with WebSphere Development Tools.
Dig Deeper on Web Development
Related Q&A from Jim Mason
Java to Excel with the AS400 may be attractive, but if you have complex VBA macros in Excel, the JDBCODBC bridge will not work well for you. A better...continue reading
There are a couple of options for accessing AS/400 data, from the old way using Client Access ODBC drivers, to Java, to a new application from Groovy.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.