Re-directing the output of the IDMS Server sample programs.
search cancel

Re-directing the output of the IDMS Server sample programs.

book

Article ID: 21630

calendar_today

Updated On:

Products

IDMS IDMS - Database

Issue/Introduction

The install of IDMS Server provides two sample programs, IdmsJcf and IdmsExample.java. They both generally allow the use to enter an ad-hoc SQL query and view the output. Can anything else be done with the output?

Environment

Release: All supported releases.
Component: IDMS Server.

Resolution

IdmsJcf

This is a program that uses the Windows GUI to allow the end user to interactively enter an SQL statement and have that statement executed via IDMS Server and see the result immediately. This output is displayed in the Windows dialog. It cannot be cut-and-paste at a text level so there is not much more that can be done with that data.

IdmsExample.java

This has much the same functionality as IdmsJcf but it doesn't use the Windows GUI. It runs is a DOS-box ("Command Prompt"), effectively a "batch" program. The SQL statements can be provided either as terminal input to the program or in an input file. The output is written as standard output to the terminal. As it runs as a DOS program, the output can be redirected like any other DOS program could be.

For example:

java example.IdmsExample url=jdbc:idms://host-name:port-number/appldb uid=XXXXXXX sqlin.txt > sqlout.txt

This will take the input SQL from file "sqlin.txt" and write the output to file "sqlout.txt".

Additional Information