Skip to main content

%SQL.FDW.Java

class %SQL.FDW.Java extends %SQL.FDW.Abstract

Property Inventory

Method Inventory

Parameters

parameter JAVACLASS;
Class in the Foreign Table package

Properties

property Gateway as %External.Gateway;
Object representing instance of a specific connection to the external language server
Property methods: GatewayGet(), GatewayGetSwizzled(), GatewayIsValid(), GatewayNewObject(), GatewaySet()
property Ptr as %Integer;
Left in for Fetch(), which isn't how we codegen FT TVFs anyway
Property methods: PtrDisplayToLogical(), PtrGet(), PtrIsValid(), PtrLogicalToDisplay(), PtrNormalize(), PtrSet()
property ReaderObject as %Net.Remote.Object;
Property methods: ReaderObjectGet(), ReaderObjectGetSwizzled(), ReaderObjectIsValid(), ReaderObjectNewObject(), ReaderObjectSet()

Methods

method %Next(ByRef sc As %Library.Status = $$$OK) as %Library.Integer
Advance the result set cursor to the next row. Returns 0 if the cursor is at the end of the result set.. An optional argument contains a %Library.Status value on return. This %Status value indicates success or failure of the %Next call. %SQLCODE is also set by %Next.
method %OnNew() as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method CreateReaderObject(Server As %String, FTClassName As %String) as %Status
Creates an object of the class containing the functionality needed to access an external source. For now, these will be Java objects (to read CSV/external DBs through JDBC). 1) Create request string, which is used by the external code to connect to the relevant external source. 2) Instantiate the object, store it in ReaderObject property Called by %SQL.FDW.Common:Execute()
method Execute(Parameters As %List = "") as %Status
Execute the query. For Java FDWs, this blends with the Prepare()
method GetRequestObject(Server As %String, FTClassName As %String) as %DynamicObject
Build and return request string used by Reader code for connecting to a database. For a file, Server host = abs. path to directory, Table = filename+extension, port & user & pass are all N/A
method GetSQLMetaData(Output metadata) as %Status
Inherited description: Every foreign data wrapper should build it's own version of this method to return metadata about the columns that will be provided by the foreign data wrapper. Each one should return metadata as specified below. This metadata should be made available as requested after the Prepare() stage of the foreign data wrapper. If desired, a foreign data wrapper can wait until this method is called to retrieve and then build the corresponding metadata structure. see also %SQL.StatementMetadata:%GenerateMetadata() metadata = $lb() 1 - # of SELECT columns 2 - i: 1) Name 2) ODBC Type 3) Precision 4) Scale 5) NULLABLE (integer) 6) Column Label (same as Name) 7) Column Table Name 8) Column Schema Name 9) Column Qualifier Name - NULL 10) $Char(1)/$Char(0) string / $Extract position: 1) isAutoIncrement 2) isCaseSensitive 3) isCurrency 4) IsReadOnly 5) IsRowVersion 6) IsUnique 7) IsAliased 8) IsExpression 9) IsHidden 10) IsIdentity 11) IsKeyColumn 12) IsRowid 13) IsList
method Prepare(Server As %String, FTClassName As %String, Query As %String, Parameters As %List = "") as %Status
Prepare the query for execute; since this is a Java FDW, that means opening the java gateway connection and getting an object to execute with
method Reset() as %Status
Inherited description: Reset the result set back to the first row. Note this may entail a full re-execution depending on the specific implmentation of the foreign data wrapper.

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab