Virtuoso

JDBC connection to Virtuoso under LOG4JDBC

In the following I describe two ways to connect. You must have already checked this page for more information.

http://docs.openlinksw.com/virtuoso/VirtuosoDriverJDBC.html

The JDBC driver is available under the folder

/usr/local/src/virtuoso-opensource/libsrc/JDBCDriverType4

assuming you have already cloned the git repository from here

https://github.com/openlink/virtuoso-opensource

Imagen
Attachment Size
log4jdbc4-1.2.jar63.4 KB 63.4 KB
virtjdbc4_1.jar299.42 KB 299.42 KB

Exporting CSV data from Virtuoso

To export csv

cbw.DBA.csvExport('SELECT * FROM cbw.DBA.mytable', '/Users/asanchez75/Trash/instances.csv');

To import csv
csv_load_file('/Users/asanchez75/Trash/myfile.csv',0, null, 'cbw.DBA.mytable');

You must create the procedure before

<code>
create procedure
exmo.DBA.csvExport( IN in_query VARCHAR, IN filename VARCHAR )
{

declare query varchar;
query := split_and_decode(in_query,0,'%');

file_delete(filename,1);

Etiquetas