This is a demo of the oracle wallet usage. You will find here examples in java, python and sqlplus. The wallet is a way to store encrypted login and password information. The wallet is generated and distributed by the DBA. On the client side you must configure
- An sqlnet.ora file that tells where the wallet lives.
- A tnsname.ora file that tells the ip and service name of the database. The test database in this example is called WDEMO2_TESTING.
- A copy of the wallet directory that stores the credentials.
It assumes that the oracle instant client, pip and java are installed. Ask your local DBA to create a wallet for you. You should also might want to copy a running wallet on a tns directory. You can use the container to have everything you need, except the wallet.
Edit tns/tnsnames.ora to match your database ip and service. Generate the wallet files and copy them to tns/wallet.
In order to use wallet you must add to this code the following jars:
- ojdbc8.jar
- oraclepki.jar
- osdt_cert.jar
- osdt_core.jar
They are downloaded via maven so you must have it first. You can also find them here.
Invoking the wallet on java is done by using 'jdbc:oracle:thin:/@TESTWALLET'
You can add a TNS_ADMIN file to tell where the tnsnames is.
In this case there is a single user on the wallet. In python you invoke the wallet config by using the dsn TESTWALLET. In sqlplus you must use /@TESTWALLET
docker build -t walletcontainer .
docker run -it walletcontainer:latest /bin/bash
Run make all
. This is done on the container build.
On the container, execute
make run-java
make run-python
make run-sqlplus
Look at the Makefile to see how it was executed.