Ask the Expert

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:

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.


This was first published in October 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: