Execute Data Virtuality Scripts in the Command Line via JISQL
It is possible to access your Data Virtuality server instance via command line or terminal. Using JISQL, the Java based interactive shell for executing SQL scripts, one is able to connect to Data Virtuality Server using the Data Virtuality JDBC driver. From here, one could easily automate stored procedures through the shell prompt. Here's how to begin:
- First, download the Data Virtuality JDBC driver from http://<host address>:8080/downloads.html
- Move this .jar file to a location on your machine that makes sense. For Mac users, the default location for JDBC drivers is /Library/JDBC.
- Then, download the JISQL dependencies from the website repository - https://www.xigole.com/software/jisql/jisql.jsp (choose the compressed file appropriate for your enviroment)
- Next, unzip the folder into your JDBC directory; this can be the same location as referenced above.
- Open the Terminal or Shell to initiate a connection using the Data Virtuality JDBC driver. An example connection string might look like so:
java -cp /Library/JDBC/jisql-2.0-2.11/lib/jisql-2.0.11.jar:/Library/JDBC/jisql-2.0-2.11/lib/jopt-simple-3.2.jar:/Library/JDBC/datavirtuality-jdbc.jar com.xigole.util.sql.Jisql -user admin -password admin -driver com.datavirtuality.dv.jdbc.Driver -cstring jdbc:datavirtuality:datavirtuality@mms://localhost:31001 -c \;;
*Execute the above line and please make sure to replace the credentials and server address here with your correct connection information.
Once successfully connected to Data Virtuality, the SQL query prompt will appear and you will be able to start executing SQL queries to Data Virtuality from the Terminal. To test that the server is responding correctly, we can make a simple call to the "SYS" Schema like so:
1 > SELECT "Name" FROM "SYS.Tables";;
You have now successfully connected to Data Virtuality using JISQL.
Please sign in to leave a comment.
Comments
0 comments