Jump to content

OREXX/SQL Object Framework: Difference between revisions

From EDM2
No edit summary
Line 1: Line 1:
==Description==
A set of [[Object REXX]] classes that allows you to write scripts that talk to multiple variations of [[SQL]] databases without having to change your scripts, it achieves this by either wrapping around the [[REXX/SQL]] Classic [[REXX]] extension or it can also be used as a Streams based interface to a SQL database, either of these interfaces can be used to build more complex classes with. The OREXX/SQL Object Framework also manages the database connections and has some built in error handling facilities. 
The ORexx/SQL Object Framework is a set of ORexx classes which encapsulate
Mark Hessling's Rexx/SQL interface to SQL databases available from:


    http://www.lightlink.com/hessling/
==Version==
* Last known version: [http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/dev/orexx&file=orexxsql.zip OREXX/SQL v1.1]  (1998)
: Note that while this version is old it appears to work on not just the old OS/2 version of Object REXX but also more modern [[Microsoft Windows]], [[AIX]] and [[Linux]] releases of the package with a couple of caveats listed below.


The Rexx/SQL interface provides cross platform (OS/2, UNIX, Win 95/NT),
;Known issues
RDBMS independent (too many to list here, see the web page) access to
The OREXX/SQL package works just fine with old versions of [[REXX/SQL]] of a similar vintage to the OREXX/SQL package, it also works with newer versions of REXX/SQL up to and including v2.6 Beta 3 with two known issues.
SQL databases through a loadable external rexx library. The ORexx/SQL
Object Framework extends this functionality by providing an extensible
Object Oriented interface to Rexx/SQL on platforms with ORexx
implementations (OS/2, Win 95/NT & Linux). The Framework further
simplifies SQL database access by managing database connections and  
queries for the programmer and through its built in error handling
facilities.


The framework can be used in two ways, either as an OO wrapper for the  
Firstly some of the SQL commands and formats introduced with later REXX/SQL versions and/or later versions of databases, are not passed on correctly by OREXX/SQL either by the wrapper or the Streams interface, you may or may not need them but if you do it should be noted that unlike the REXX/SQL package that requires you to compile [[C]] code to change the behaviour, OREXX/SQL is simply a set of classes written in Object REXX so you can actually modify the SQLConnection.cls class to pass on the required commands correctly. There is a discussion on this on one of the REXX/SQL support forums on this subject linked to below.
Rexx/SQL interface or as a Streams based interface to a SQL database.
Either of these interfaces can be used as the basis for more complex,
reusable, application specific classes.


When used as wrapper classes, you create connection, table and result table
Secondly the REXX/SQL package does not support multithreading, this means it expects all calls made to it to be made by the same thread that originally initiated the connection. Most Classic REXX interpreters only talk to extensions on a single thread but Object REXX can under certain circumstances use more than one thread. There are various ways around this depending on OS, but on OS/2 you should in most cases not see this bug unless you explicitly start a new thread.
objects as needed and use the methods provided by these objects to query and
update database tables. This gives you access to the entire functionality of
the Rexx/SQL interface.


When using the Streams interface, you create SQLStream objects which create
==Links & publications==
and manage other SQL objects as needed. SQLStream objects allow you to
* [[Howard Fosdick]] and [[Jon Wolfers]]: [http://www.bitwisemag.com/2/spip4b3a.html?page=print_format&id_article=138 An Easy Way to Manage SQL Queries ...USING OOREXX]
access a database using an interface similar to that which standard Stream
* [https://sourceforge.net/p/oorexx/discussion/408477/thread/0b4418f5/ Discussion on the REXX/SQL support forum] - in regards to the threading bug mentioned above.
objects provide.


In addition to providing an OO interface to Rexx/SQL, the classes have built
==Licence==
in exception handling which can be customized or overridden. Using the
* Open source software released under the [[LGPL v.2.1]].
Framework's exception handling eliminates the need for inline error checking
and allows the programmer to write code which is easier to read and maintain.
 
The ORexx/SQL Object Framework was developed and tested on Windows NT with
an Oracle server. If you are using a different platform or database and
experience problems using ORexx/SQL Objects let me know and I'll try
to incorporate any necessary changes into future versions or pass on your
problems to Mark Hessling if appropriate.
 
 
==Download==
* [http://hobbes.nmsu.edu/h-viewer.php?dir=/pub/os2/dev/orexx&file=orexxsql.zip Version 1.1]
 
==License==
* GNU LGPL - Open Source


==Author==
==Author==
* [[John Blumel]]
* [[John Blumel]]


==Links==
[[Category:Tools]][[Category:REXX]][[Category:MS Windows Tools]][[Category:Databases]][[Category:SQL]][[Category:AIX Tools]][[Category:Linux Tools]][[Category:Open Source Software]][[Category:Software written in REXX]]
 
[[Category:Tools]]

Revision as of 13:00, 5 March 2016

A set of Object REXX classes that allows you to write scripts that talk to multiple variations of SQL databases without having to change your scripts, it achieves this by either wrapping around the REXX/SQL Classic REXX extension or it can also be used as a Streams based interface to a SQL database, either of these interfaces can be used to build more complex classes with. The OREXX/SQL Object Framework also manages the database connections and has some built in error handling facilities.

Version

Note that while this version is old it appears to work on not just the old OS/2 version of Object REXX but also more modern Microsoft Windows, AIX and Linux releases of the package with a couple of caveats listed below.
Known issues

The OREXX/SQL package works just fine with old versions of REXX/SQL of a similar vintage to the OREXX/SQL package, it also works with newer versions of REXX/SQL up to and including v2.6 Beta 3 with two known issues.

Firstly some of the SQL commands and formats introduced with later REXX/SQL versions and/or later versions of databases, are not passed on correctly by OREXX/SQL either by the wrapper or the Streams interface, you may or may not need them but if you do it should be noted that unlike the REXX/SQL package that requires you to compile C code to change the behaviour, OREXX/SQL is simply a set of classes written in Object REXX so you can actually modify the SQLConnection.cls class to pass on the required commands correctly. There is a discussion on this on one of the REXX/SQL support forums on this subject linked to below.

Secondly the REXX/SQL package does not support multithreading, this means it expects all calls made to it to be made by the same thread that originally initiated the connection. Most Classic REXX interpreters only talk to extensions on a single thread but Object REXX can under certain circumstances use more than one thread. There are various ways around this depending on OS, but on OS/2 you should in most cases not see this bug unless you explicitly start a new thread.

Links & publications

Licence

  • Open source software released under the LGPL v.2.1.

Author