Initial Release
Example about an IRIS production connected by JDBC to a MySQL database throught JGW
You can find more in-depth information in https://learning.intersystems.com.
New to IRIS Interoperability framework? Have a look at IRIS Interoperability Intro Workshop.
Build the image we will use during the workshop:
$ git clone https://github.com/intersystems-ib/workshop-sql-jgw
$ cd workshop-sql-jgw
$ docker-compose build
The main purpose of this example is to get all new data recorded into Patient table and make it accesible from a production in IRIS. You will also be able to write some record into MySQL table.
Run the containers we will use in the workshop:
docker-compose up
mysql
root
SYS
test
Automatically an IRIS instance will be deployed and a production will be configured and run to read new records from a MySQL database.
superuser
/ SYS
account.EnsLib.JavaGateway.Service
and review the configuration.
EnsLib.SQL.Service.GenericService
. Open Messages tab and check it, you can see that there is a message for each row in the table.Opening Visual Studio Code you will be able to review the business operation used to read the object created for each row in Patient’s table and the object definition
Code to read the patient’s object:
set context.patientStream = ##class(Ens.StreamContainer).%New()
set stream = ##class(%Stream.GlobalCharacter).%New()
do stream.Write(request.Id_" "_request.Name_" "_request.Lastname_$Char(13)_$Char(10))
set context.patientStream.Stream=stream
Patient’s object definition:
Class Test.Patient Extends (%Persistent, %JSON.Adaptor, %XML.Adaptor, Ens.Request) {
Property Id As %Integer;
Property Name As %String;
Property Lastname As %String;
}
EnsLib.SQL.Service.Operation
operation in your production.Test.Patient