File Based Connectors
The file-based connectors bridge between Data Virtuality Server and local and remote file storage systems.
type name | description | specific features |
---|---|---|
ufile | access and manage files at local filesystem | |
ftp | access and manage files via ftp protocol | |
sftp | access and manage files via sftp protocol | |
scp | access and manage files via scp protocol | |
s3 | access and manage files stored at Amazon AWS S3 storage | |
blob | access and manage files stored at Azure Blob Storage |
Metadata
Before issuing queries to the file data source, we need to configure the data source using appropriate Data Virtuality Server procedures:
Example
call SYSADMIN.createConnection( name => <alias>, jbossCLITemplateName => <type name>, 'connectionOrResourceAdapterProperties => '<connector specific setting depending on type>');
call SYSADMIN.createDatasource( name => <alias>, translator => 'ufile', modelProperties => '', translatorProperties => '');
The translator has to be 'ufile' for all file-based data sources.
Data Virtuality Studio provides a comfortable way to connect to data sources using graphical wizards. In order to do so, use the corresponding data source type under File section in the Add data source wizard.
Usage
File data sources are utilizing stored procedures shared by all file-based connectors to gather data from their sources. These data may be further processed by Data Virtuality Server. This is commonly done with table functions (like TABLE, TEXTTABLE and XMLTABLE) in combination with parsing functions depending on a data structure.
Data Virtuality Studio provides a variety of Query Builders for that purpose. They allow an easy specification for file encoding and structure of data. These Query Builders are accessible via "SQL editor" - "Tools".
Stored procedures shared by all File Based Connectors
name of the procedure | input parameter (data type / nulls allowed) | example call & purpose |
---|---|---|
getFiles |
| Retrieves all files as If the extension path is specified, then it will filter all of the file in the directory referenced by the base path. If the extension pattern is not specified and the path is a directory, then all files in the directory will be returned. Otherwise, the single file referenced will be returned. Usage
SQL
Example
SQL
|
getTextFiles |
| Retrieves all files as All the same files as with Usage
SQL
Example
SQL
|
saveFile |
| Saves the Usage
SQL
PathAndPattern has slightly different meaning here than for the other file based connector procedures. Actually its specifiing path and filename, not a pattern. Example
SQL
|
|
| Lists all files from specified directory. Usage
SQL
Example
SQL
|
|
| Deletes all files matching the pattern.
SQL
|