3

I am trying to write a small program that utilizes a sql script I wrote, to access data within a Derby DB (let's call it "myscript.sql") from within a ksh script.

I seem to be running into problems however since my ksh script can only launch the "ij" tool, and is not able to input any further commands in the ij shell once opened (thus, can not connect to the DB).

Is there any way that the ksh script can echo commands to the ij shell, so I can connect/execute my query as needed ?

1 Answer 1

3

You can accomplish this by redirecting stdin to the ij tool and running it using java:

Name an input file as a command-line argument. For example:

java org.apache.derby.tools.ij myscript.sql

Redirect standard input to come from a file. For example:

java org.apache.derby.tools.ij < myscript.sql

Source: Derby documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.