Slide 10.9: Using Oracle9.2.0i on the server with an IP address 172.20.4.9 Slide 11.1: Oracle database management systems Home |
shell
.zshrc
File..zshrc
is the file read and executed each time a zsh, which is the default shell used by shell
, is started.
To use Oracle JDBC, you need to set environment variables in ~/.zshrc file by including the following commands:
~/.zshrc
|
||
---|---|---|
PATH=$PATH:/home/Agassiz:/usr/java/bin:/usr/java/sdk/bin CLASSPATH=.:/home/Agassiz/project/oracle/OraHome1/jre/1.1.8 CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jlib CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jdbc/lib/classes12.zip CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/jdbc/lib/nls_charset12.zip CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/sqlj/lib/runtime.zip CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/sqlj/lib/translator.zip CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/ord/jlib CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/ord/ts/jlib CLASSPATH=$CLASSPATH:/home/Agassiz/project/oracle/OraHome1/rdbms/jlib CLASSPATH=$CLASSPATH:/usr/j2se/bin export CLASSPATH |
.zshrc
file, you may exit the shell
and re-enter it to have the environment variables and shell options set.
MyJDBC.java
.
Two sample JDBC programs can be found from EnterCustomer.java and ListCustomers.java.
shell> /usr/bin/javac MyJDBC.java shell> /usr/bin/java JDBCTestAssume the Java compiler creates a class
JDBCTest.class
.