Problem solve Get help with specific problems with your technologies, process and projects.

Access a file in QTEMP library using Java

How can I access a file in QTEMP library (using Java) knowing that the temporary file was created before the execution...

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:


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.


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.

This was last published in October 2002

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.