SQLLine is a Java console based for connecting to databases to execute SQL commands. This is a helper tutorial for other guides. Here is How to Install SQLLine on Ubuntu For Using With Big Data Tools. SQLLine depends on Java Virtual Machine, JLine console reader, JDBC driver (any JDBC compliant driver can be used). Of course we can use the same way of installation on Windows 10 Bash and Android bah with Termux.
Steps on How to Install SQLLine on Ubuntu
There is probably an apt version of sqlline
, probably that is backdated. You should check what your application wants. There is a Python SQLLine :
1 | https://bitbucket.org/lalinsky/python-sqlline |
We are showing Java SQLLine.
---
Install Java virtual machine :
1 2 3 4 5 6 | apt-get update && apt-get upgrade apt-get install software-properties-common Step 2: Add the Java repository add-apt-repository ppa:webupd8team/java apt-get update sudo apt-get install oracle-java8-installer |
java7 or java9 are releases are not recommended for development. Verify that Java and the Java compiler have been properly installed:
1 2 | java -version javac -version |
To set the variable for your system:
1 | echo "JAVA_HOME=$(which java)" | sudo tee -a /etc/environment |
Reload your system’s environment variables:
1 | source /etc/environment |
Verify the variable was set correctly:
1 | echo $JAVA_HOME |
Install Apache Maven following our previous guide.
Create a directory named sqllinedir
and work with Jline, sqlline from that directory. Install Jline from :
1 | https://github.com/jline/jline3 |
These are the needed commands :
1 2 3 4 5 | mkdir /opt/sqllinedir cd /opt/sqllinedir git clone git://github.com/jline/jline3.git cd jline3 ./build rebuild |
Download your database specific JDBC driver files into that sqllinedir
directory. For example, MySQL JDBC driver can found on MySQL’s site :
1 | https://www.mysql.com/products/connector/ |
Te above step will change according to your need to use SQLLine. Final step is installing SQLLine itself. The SQLLine we are showing is fork of Marc Prud’hommeaux’s original SQLLine project on SourceForge. It is somewhat modernized :
1 2 3 | git clone git://github.com/julianhyde/sqlline.git cd sqlline mvn package |
Other matters related to SQLLine remains same. The old SourcForge reference of all commands of SQLLine is still a good place to start with :
1 | http://sqlline.sourceforge.net/#sect_command_all |
Probably we could omit some steps with the new forked version. However, some of the tools assumes they are installed.
Tagged With how to use sqlline , ubuntu sqlline oracle