undcemcs02.und.edu
.~/.bash_profile
File.~/.bash_profile
is the personal initialization file and gets executed whenever you log in to undcemcs02
.
It is located in a user’s home directory and tilde slash (~/
) is the beginning of a path to a file or directory below the user’s home directory.
To use Oracle JDBC, you need to set environment variables in ~/.bash_profile
file by including the following commands:
~/.bash_profile
|
# To set up the Oracle environment for your shell account CLASSPATH=.:/usr/lib/oracle/23/client64 CLASSPATH=$CLASSPATH:/usr/lib/oracle/23/client64/lib/ojdbc8.jar CLASSPATH=$CLASSPATH:/usr/lib/oracle/23/client64/lib/ottclasses.zip export CLASSPATH # To set up the Oracle environment for SQL*Plus export ORACLE_HOME=/usr/lib/oracle/23/client64 export LD_LIBRARY_PATH=${ORACLE_HOME}/lib export PATH=${ORACLE_HOME}/bin:$PATH export CLASSPATH |
.bash_profile
file:
undcemcs02> source ~/.bash_profile
MyJDBC.java
.
Two sample JDBC programs can be found from EnterCustomer.java
and ListCustomers.java
.
MyJDBC.class
,
undcemcs02> /usr/bin/javac MyJDBC.java undcemcs02> /usr/bin/java MyJDBCwhere the Java compiler and interpreter are located at