Using KateSQL to connect to an Oracle database in Kate
oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm The first package is the client itself, providing the files required to run OCI applications. The second is the Instant Client SDK which includes header files for developing Oracle applications with Instant Client: in our case an OCI library for the Qt SQL module. Users of RPM-based distributions can just go ahead and install these packages while others will need to convert them to
.deb format first. The best way to do this that I am aware of is with the tool called
Alien. Let's install it, convert the Oracle Instant Client packages, and install them too. [sourcecode language="bash" gutter="false"] cd /path/to/oracle/instant/client/files sudo apt-get install alien sudo alien oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm sudo alien oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm sudo dpkg -i oracle-instantclient11.2-basic_11.2.0.2.0-2_i386.deb oracle-instantclient11.2-devel_11.2.0.2.0-2_i386.deb [/sourcecode] The next step is to install all of the dependencies necessary to build the Qt SQL OCI library. [sourcecode language="bash" gutter="false"] sudo apt-get build-dep qt4-x11 sudo apt-get install qt4-qmake libqt4-dev libaio1 [/sourcecode] Then we will need the actual source code for the
qt4-x11 package. This can be obtained with the following command: [sourcecode language="bash" gutter="false"] apt-get source qt4-x11 [/sourcecode] To recap, at this point we've downloaded and installed the Oracle Instant Client and all of the dependencies required to build the
qt4-x11 package, and we've downloaded the
qt4-x11 source code. Next we're going to build the Qt SQL OCI library itself. [sourcecode language="bash" gutter="false"] sudo ln -s /path/to/qt4-x11-4.7.0/src /usr/include/src sudo cp -r /path/to/qt4-x11-4.7.0/include/QtSql/private /usr/include/qt4/QtSql/ cd /usr/include/src/plugins/sqldrivers/oci/ qmake "INCLUDEPATH+=/usr/include/oracle/11.2/client64" "LIBS+=-L/usr/lib/oracle/11.2/client64/lib -Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -lclntsh -lnnz11" oci.pro make sudo make install [/sourcecode] Now that the
libqsqloci.so module has been built and installed, Kate should be able to connect to an Oracle database. Launch Kate (or close and re-open it if it was already running), click
Settings -> Configure Kate, expand the
Application tree if necessary, click
Plugins, check '
SQL Plugin' and click OK. Then click
SQL -> Add connection to launch the connection wizard. In addition to the MySQL and SQLite database drivers, you should now also have drivers named QOCI and QOCI8 available. Choose the appropriate one, enter relevant connection details, and complete the connection wizard. You can now execute queries against the database and display result data.
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Token-Based Authentication for ADB with IAM: Part 1

Token-Based Authentication for ADB with IAM: Part 1
Jun 3, 2022 12:00:00 AM
9
min read
The power of the Oracle Database Proxy authenticated connections
The power of the Oracle Database Proxy authenticated connections
Oct 27, 2014 12:00:00 AM
6
min read
Using FreeRadius to Authorize Oracle Connections
Using FreeRadius to Authorize Oracle Connections
Mar 18, 2020 12:00:00 AM
7
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.