DB2: Embedded SQL for Java (SQLJ) |
This will walk you
through "compiling" an embedded SQLJava program. See the
directories
Someone kindly pointed out some good resources for learning JDBC and SQLJ:
|
First things first.
To bind, compile, and later run your Java APPs, you will need to
log onto one of the machines
sen01 through sen20 or
dem01
through dem24 in the Ariel laboratory. The machine red will not
work. I repeat, the machine red will not work. (Read on and you will learn
why.)
However, you will need to have "primed" your shell by running
To bind your Java APP (and hence, to create a package) say The package created will have the name program_SJ0. Packages are like tables in a DB2 database. They are objects which belong to schemas. To see one's current packages, type Okay, so what is with the urun command? It allows the process to run with unlimited bounds on virtual memory. (Student accounts have a bound placed on this.) On Red, the urun command is not available to override this. (Too many people use Red, so programs that are major virtual memory hogs would be trouble.) On sen01 through sen24 and dem01 through dem24, however, the urun command is available to override this. Java, especially in this context, is a major virtual memory hog.
|
Here is an example
embedded SQL Java program. It does not do much, but is instructive.
It does the same thing as the example C program in the embedded
SQL C guide. The APP queries a table sailor in schema techstu.
User techstu has granted select privileges to all on
table sailor, so the bind step will be legal.
SNAME SID RATING AGE --------------- ----------- ------ ------ yuppy 22 1 20 lubber 31 1 25 guppy 44 2 31 rusty 58 3 47
|