CREATE FOREIGN DATA WRAPPER

As in other SQL-based systems, foreign data wrappers handle access to external objects from s-Server. Two commonly referenced data wrappers are ECDA, a wrapper that handles connections to a variety of data sources, including the file system, Kafka topics, network sockets, Kinesis streams, and AMQP; and SYS/JDBC, which handles connections to RDBMS systems.

Syntax

Syntax Chart for CREATE FOREIGN DATA WRAPPER Example of specifying a library and a language:

CREATE FOREIGN DATA WRAPPER probeWrapper
LIBRARY '/usr/lib/sqlstream/adapters/probeReader.jar'
LANGUAGE JAVA;

Example of option specification:

OPTIONS ( protocol'TCP/IP')

Notes: - If a data wrapper specifies a JAR file rather than a class file, then the JAR is automatically added to CLASSPATH. (It is not necessary to register it with the SQLstream engine by adding it into the file $SQLSTREAM_HOME/bin/classpath.gen.) This is the effect, for example, of using statement A below instead of statement B:

  • LIBRARY ‘${FARRAGO_HOME}/plugin/FarragoMedJdbc.jar’
  • LIBRARY ‘class net.sf.farrago.namespace.jdbc.MedJdbcForeignDataWrapper’

CREATE FOREIGN DATA WRAPPER is unnecessary when defining a server for a JDBC peer using a JDBC client driver that matches the RDBMS, such as those that come with SQLstream for SQLServer, Oracle, MySQL, and SQLstream. For these RDBMS, you can define the server for a JDBC peer using the CREATE SERVER command, specifying FOREIGN DATA WRAPPER “SYS_JDBC.

See SYS_JDBC in the SQLstream s-Server Integration Guide