Oracle writes an explanation of saving data into Oracle after determining whether the content is weather.
At the beginning of writing a program, I wrote an order processing system. All kinds of warehouse receiving, warehouse picking, order tracking, Waybill tracking, and product mounting and dismounting were completed using MySQL, and I felt that there was no difficulty, after installing the api, you can use it. Recently, you have written a record to store data in Oracle after determining whether the content is weather. The Oracle operation process is worth recording.
I use python to operate Oracle. Therefore, I need to install the dependent package cx_Oracle. Here, I use pip to install it:
pip instll cx_Oracle
After installing the package, you still have to install a dependency package. Otherwise, the following error will be reported:
DPI-1047: 64-bit Oracle Client library cannot be loaded: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help
Click the website where the error message is displayed and select the software to download. For linux, you only need to download the instantclient, and then install the dependency and configuration variables as prompted on the webpage. For windows, you need to install the compiling environment, different instantclient versions correspond to different compilation packages. Read carefully during download,
The python operation connection data is as follows:
Method 1:
import cx_Oracle as codb = co.connect('username', 'password', 'ip:1521/database')
Method 2:
import cx_Oracle as codb = co.connect('username/password@ip:1521/database')
Method 3:
import cx_Oracle as cotns = co.makedsn('ip', 1521, 'database')db = co.connect('username', 'password', tns)