Recital

Login Register

In this article Barry Mavin, CEO and Chief Software Architect for Recital, details on how to use the Client Drivers provided with the Recital Database Server to work with local or remote server-side JDBC data sources.

Overview

The Recital Universal .NET Data Provider provides connectivity to the Recital Database Server running on any supported platform (Windows, Linux, Unix, OpenVMS) using the RecitalConnection object.

The Recital Universal JDBC Driver provides the same functionality for java applications.

The Recital Universal ODBC Driver provides the same functionality for applications that use ODBC.

Each of the above Client Drivers use a connection string to describe connections parameters.

The basic format of a connection string consists of a series of keyword/value pairs separated by semicolons. The equals sign (=) connects each keyword and its value.

The following table lists the valid names for keyword/values.


Name Default Description

Data Source
-or-
Server
-or-Nodename

  The name or network address of the instance of the Recital Database Server which to connect to.
Directory   The target directory on the remote server where data to be accessed resides. This is ignored when a Database is specified.

Encrypt
-or-
Encryption

false When true, DES3 encryption is used for all data sent between the client and server.
Initial Catalog
-or-
Database
  The name of the database on the remote server.
Password
-or-
Pwd
  The password used to authenticate access to the remote server.
User ID   The user name used to authenticate access to the remote server.

Connection Pooling
-or-
Pool

false Enable connection pooling to the server. This provides for one connection to be shared.
Logging false Provides for the ability to log all server requests for debugging purposes
Rowid true When Rowid is true (the default) a column will be post-fixed to each SELECT query that is a unique row identifier. This is used to provide optimised UPDATE and DELETE operations. If you use the RecitalSqlGrid, RecitalSqlForm, or RecitalSqlGridForm components then this column is not visible but is used to handle updates to the underlying data source.
Logfile   The name of the logfile for logging
Gateway  

Opens an SQL gateway(Connection) to a foreign SQL data source on the remote server.
Using Gateways, you can transparently access the following local or remote data sources:

  • Recital
  • Oracle
  • ODBC (Server-side ODBC data sources)
  • JDBC (Server-side JDBC data sources)
  • ADO (Use this to connect to SQL Server and other Native Windows OLEDB data sources)
  • MySQL
  • PostgreSQL
The gateway can be specified in several formats:
servertype@nodename:username/password-database
e.g.
oracle@nodename:username/password-database
mysql@nodename:username/password-database
postgresql@nodename:username/password-database
-or-
odbc:odbc_data_source_name_on_server
oledb:oledb_connection_string_on_server
jdbc:jdbc_driver_path_on_server;jdbc:Recital:args

To connect to a server-side JDBC data source, you ue the gateway=value key/value pair in the following way.

gateway=jdbc:jdbc_driver_path_on_server;jdbc:Recital:args

You can find examples of connection strings for most ODBC and OLE DB data sources by clicking here.

Example in C# using the Recital Universal .NET Data Provider:
////////////////////////////////////////////////////////////////////////
// include the references below
using System.Data;
using Recital.Data;

////////////////////////////////////////////////////////////////////////
// The following code example creates an instance of a DataAdapter that 
// uses a Connection to the Recital Database Server, and a gateway to
// Recital Southwind database. It then populates a DataTable 
// in a DataSet with the list of customers via the JDBC driver. 
// The SQL statement and Connection arguments passed to the DataAdapter 
// constructor are used to create the SelectCommand property of the
// DataAdapter.
public DataSet SelectCustomers()
{
	string gateway = "jdbc:/usr/java/lib/RecitalJDBC/Recital/sql/RecitalDriver;"+
			"jdbc:Recital:Data Source=localhost;database=southwind";       
	RecitalConnection swindConn = new
			RecitalConnection("Data Source=localhost;gateway=\""+gateway+"\");
	RecitalCommand selectCMD = new
			RecitalCommand("SELECT CustomerID, CompanyName FROM Customers", swindConn);
	selectCMD.CommandTimeout = 30;
	RecitalDataAdapter custDA = new RecitalDataAdapter();    
	custDA.SelectCommand = selectCMD;    
	swindConn.Open();    
	DataSet custDS = new DataSet();
	custDA.Fill(custDS, "Customers");    
	swindConn.Close();
	return custDS;
}
Example in Java using the Recital Universal JDBC Driver:
////////////////////////////////////////////////////////////////////////
// standard imports required by the JDBC driver
import java.sql.*;
import java.io.*;
import java.net.URL;
import java.math.BigDecimal;
import Recital.sql.*;

////////////////////////////////////////////////////////////////////////
// The following code example creates a Connection to the Recital // Database Server, and a gateway to the Recital Southwind database. // It then retrieves all the customers via the JDBC driver. public void SelectCustomers() { // setup the Connection URL for JDBC String gateway = "jdbc:/usr/java/lib/RecitalJDBC/Recital/sql/RecitalDriver;"+ "jdbc:Recital:Data Source=localhost;database=southwind"; String url = "jdbc:Recital:Data Source=localhost;gateway=\""+gateway+"\";
// load the Recital Universal JDBC Driver new RecitalDriver(); // create the connection Connection con = DriverManager.getConnection(url); // create the statement Statement stmt = con.createStatement(); // perform the SQL query ResultSet rs = stmt.executeQuery("SELECT CustomerID, CompanyName FROM Customers"); // fetch the data while (rs.next()) { String CompanyID = rs.getString("CustomerID"); String CompanyName = rs.getString("CompanyName"); // do something with the data... } // Release the statement stmt.close(); // Disconnect from the server con.close(); }
Published in Blogs
Read more...
Recital 10 introduced the ECHO command. This command operates in the same way as the PHP ECHO command. It does not append a newline to the output but rather operates in the same way as the existing ?? command in Recital. The string being output can contain C-style string escapes \n \t or \r (newline, tab and carriage return respectively) e.g.
echo "Hello world\n"
Published in Blogs
Read more...
Occasionally subversion can get itself confused about what is and what is not in a working copy. This usually occurs if you have replaced the contents of a directory such as when you upgrade a component in Joomla!

You receive a message such containing this:

"working copy admin area is missing"

How to resolve this: 

Step 1 -- Rename the directory that is causing the error from a shell prompt and prefix it with __ 

mv com_docman __com_docman

Step 2 -- Using your subversion client refresh your working copy, then "update" the directory that is causing the problem e.g. update com_docman.

Step 3 -- Now you can commit the __com_docman directory.

After you have done this follow these steps, using your subversion client:

Step 4 -- delete the com_docman directory from your working copy
Step 5 -- rename __com_docman back to com_docman

Now "commit all" and both your working copy and repository will be in sync.
Published in Blogs
Read more...
Recital 10 introduced a FOREACH command, much like PHP and some other languages. This simply gives an easy way to iterate over arrays. foreach works on arrays and objects, and will issue an error when you try to use it on a variable with a different data type or an uninitialized variable. There are two syntaxes; the second is a minor but useful extension of the first:
FOREACH array_expression AS value
    statements...
ENDFOR
FOREACH array_expression AS key => value statements... ENDFOR
The first form loops over the array given by array_expression. On each loop, the value of the current element is assigned to value and the internal array pointer is advanced by one (so on the next loop, you'll be looking at the next element).
The second form does the same thing, except that the current element's key will be assigned to the variable key on each loop. This form works only on associative arrays and objects.
Published in Blogs
Read more...

This article talks about the log files available in Recital products and how to enable logging when required.

Overview

When discussing a problem with the Recital Support Team, one of the most common requests is that you enable logging and send them the log files produced. Log files along with error files are designed to provide detailed information about Recital processes and the prevailing environment and can be a fast-track to resolving a problem.

Log Files

There are three main types of log file:

  1. System Log
  2. Client/Server Communication Logs
  3. Custom Logs

System Log

The System log is a system-wide  all product log.  It tracks all login and logout operations from either Recital or the Recital Server. Logout details include the exit code: 0 for an error-free, 'normal' exit and the error number and message when an error has occurred. It also shows the licenses that have been loaded and any license error codes and messages. The system log filename is recital.log.
 

Client/Server Communication Logs

The Client/Server communication logs track the requests and responses between the Recital Server and its clients. The log files are as follows:


Filename Type Description

dbserver.log

System-wide

The Recital Server startup log. This logs any problems with the Recital Server startup.

port.log

System-wide

The port listener log. The port listener (or portserver) listens on port 8001 for client connection requests and spawns the appropriate server process.

net.log

Connection

The netserver log. The netserver is the Recital Server database and 4GL engine.

rsi.log

Connection

The Recital Server Interface (RSI) Gateway log. This logs communication with the Database Gateways to SQL databases.

rec.log

Connection

The Recital Database Gateway log. The Recital Database Gateway (or recserver) is the SQL database engine for Recital Gateway data access.

mys.log

Connection

The MySQL Database Gateway log.

ora.log

Connection

The Oracle Database Gateway log.

inf.log

Connection

The Informix Database Gateway log.

ing.log

Connection

The Ingres Database Gateway log.

pos.log

Connection

The PostgreSQL Database Gateway log.

jdb.log

Connection

The JDBC Driver Database Gateway log.


Custom Logs

The Recital/4GL USERLOG() function can be used to log information to a user-specific log file for debugging or audit trail purposes. For full information on this function, please see the USERLOG() documentation.

Enabling Log Files

For instructions on enabling log files for individual products, please follow these links:

Enabling Log Files: Recital Server for Windows

To enable the system log file for the Recital Universal Application Server for Windows, include the following command in the UAS\config.db file:

set syslogging on

The Recital Server Manager System Logging tab allows for the viewing and resetting of the System log.

Section

Item

Description

System Logging

DateTime

Date and time stamp of the action.

Name

Login name used by connection

Action

Action logged: Login, Logoff, Errot

Details

Details of action

Buttons

Purge

Allows the log file to be reset

Refresh

Refreshes the display

To set up Client/Server logging, use the Recital Server Manager Settings tab to update the server's Registry entries:

The following Log file settings can be configured:

Item

Description

Log files Directory Path

Enter the directory in which log files will be created. The default is the UAS\log directory.

Enabled

Check to enable log file creation.

Versions

Check to enable log file versioning.

Listener

Click to view the current port listener log file

Server

Click to view the current netserver log file

Purge

Click to purge all log files

Enabling Log Files: Recital Server for Linux

To enable the system log file for the Recital Server for Linux, include the following command in the conf/config.db file:

set syslogging on

To set up Client/Server logging, the Recital Server can be started with the 'logging' parameter, in which case, all relevant logging will take place.

# service startup logging<

Alternatively, one or more of the following environment variables can be added to the dbserver.conf file or set at the Operating System prompt.  The Recital Server must be restarted before environment variable changes will be recognized.  Each environment variable should be set to the name of a log file.

Environment Variable

Logs Activity of...

UASLOG_PORT

Port Server (db_rsiserver)

UASLOG_NET

(Net) Server (db_netserver)

UASLOG_ORA

Oracle Server (db_oraserver)

UASLOG_INF

Informix Server (db_infserver)

UASLOG_ING

Ingres Server (db_ingserver)

UASLOG_JDB

JDBC Server (db_jdbserver)

UASLOG_REC

Recital Server (db_recserver)

Extract from recital.conf:

UASLOG_PORT="port.log" ; export UASLOG_PORT
UASLOG_NET="net.log"   ; export UASLOG_NET
UASLOG_ORA="ora.log"  ; export UASLOG_ORA
UASLOG_INF="inf.log"     ; export UASLOG_INF
UASLOG_ING="ing.log"   ; export UASLOG_ING
UASLOG_JDB="jdb.log"   ; export UASLOG_JDB
UASLOG_REC="rec.log"   ; export UASLOG_REC
DB_LOGDIR

If the environment variable DB_LOGDIR is set to an existing directory, all log files will be written to this directory.  If not, the log files will be created in the bin directory.

DB_LOGDIR is set in the conf/recital.conf file. By default it is set to the log directory:

DB_LOGDIR=${ROI_ROOT}log/           ; export DB_LOGDIR
DB_LOGVER

If the environment variable DB_LOGVER is greater than 0, version numbers are added to the file names.  For example, the activity of the first Net Server process will be logged to net.log, the second to net001.log, the third to net002.log etc. up to the maximum value of DB_LOGVER.

DB_LOGVER is set in the conf/recital.conf file:

DB_LOGVER=10; export DB_LOGVER

Enabling Log Files: Recital Server for UNIX

To enable the system log file for the Recital Server for UNIX, include the following command in the conf/config.db file:

set syslogging on

To set up Client/Server logging, the Recital Server can be started with the 'logging' parameter, in which case, all relevant logging will take place.

# service startup logging

Alternatively, one or more of the following environment variables can be added to the <em>dbserver.conf</em> file or set at the Operating System prompt.  The Recital Server must be restarted before environment variable changes will be recognized.  Each environment variable should be set to the name of a log file.

Environment Variable

Logs Activity of...

UASLOG_PORT

Port Server (db_rsiserver)

UASLOG_NET

(Net) Server (db_netserver)

UASLOG_ORA

Oracle Server (db_oraserver)

UASLOG_INF

Informix Server (db_infserver)

UASLOG_ING

Ingres Server (db_ingserver)

UASLOG_JDB

JDBC Server (db_jdbserver)

UASLOG_REC

Recital Server (db_recserver)

Extract from recital.conf:

UASLOG_PORT="port.log" ; export UASLOG_PORT
UASLOG_NET="net.log"   ; export UASLOG_NET
UASLOG_ORA="ora.log"  ; export UASLOG_ORA
UASLOG_INF="inf.log"     ; export UASLOG_INF
UASLOG_ING="ing.log"   ; export UASLOG_ING
UASLOG_JDB="jdb.log"   ; export UASLOG_JDB
UASLOG_REC="rec.log"   ; export UASLOG_REC
DB_LOGDIR

If the environment variable DB_LOGDIR is set to an existing directory, all log files will be written to this directory.  If not, the log files will be created in the bin directory.

DB_LOGDIR is set in the conf/recital.conf file. By default it is set to the log directory:

DB_LOGDIR=${DB_ROOT}log/           ; export DB_LOGDIR
DB_LOGVER

If the environment variable DB_LOGVER is greater than 0, version numbers are added to the file names.  For example, the activity of the first Net Server process will be logged to net.log, the second to net001.log, the third to net002.log etc. up to the maximum value of DB_LOGVER.

DB_LOGVER is set in the conf/recital.conf file:

DB_LOGVER=10; export DB_LOGVER

Enabling Log Files: Recital Universal Application Server for OpenVMS

To enable the system log file for the Recital Universal Application Server for OpenVMS, include the following command in the db_uas:config.db file:

set syslogging on

To set up Client/Server logging, one or more of the following symbols can be added to the <em>db_uas:login.com</em> file.  The Recital Server must be restarted before symbol changes will be recognized.  Each symbol should be set to the name of a log file.

Symbol

Logs Activity of…

UASLOG_PORT

Port Server (db_rsiserver)

UASLOG_NET

(Net) Server (db_netserver)

UASLOG_ORA

Oracle Server (db_oraserver)

UASLOG_INF

Informix Server (db_infserver)

UASLOG_ING

Ingres Server (db_ingserver)

UASLOG_JDB

JDBC Server (db_jdbserver)

UASLOG_REC

Recital Server (db_recserver)

Extract from db_uas:login.com

$ uaslog_port :==  port.log
$ uaslog_net  :==  net.log
$ uaslog_ora  :==  ora.log
$ uaslog_inf  :==  inf.log
$ uaslog_ing  :==  ing.log
$ uaslog_jdb  :==  jdb.log
$ uaslog_rec  :==  rec.log
DB_LOGDIR

If the symbol DB_LOGDIR is set to an existing directory, all log files will be written to this directory.  If not, the log files will be created in the UAS directory.

DB_LOGDIR is set in the db_uas:login.com file. By default it is set to the UAS.log] directory:

$db_logdir    :== 'db_root'.log]               ! system logging directory
DB_LOGVER

If the symbol DB_LOGVER is enabled, version numbers are added to the file names. For example, the activity of the first Net Server process will be logged to net.log, the second to net001.log, the third to net002.log etc.

DB_LOGVER is set in the db_uas:login.com file:

$db_logver  :== true                           ! enable multiple log files

Enabling Log Files: Recital for Linux

To enable the system log file for Recital for Linux, include the following command in the conf/config.db file:

set syslogging on

Enabling Log Files: Recital for UNIX

To enable the system log file for Recital for UNIX, include the following command in the conf/config.db file:

set syslogging on

Enabling Log Files: Recital for OpenVMS

To enable the system log file for Recital for OpenVMS, include the following command in the db_ovd:config.db file:

set syslogging on

In Brief

  • Log files provide important information to aid problem resolution, but they are also an overhead, so logging should only be enabled when required, not in normal production operation.
  • The System log provides a system-wide view of logins, exits and error codes.
  • The System log can be viewed in table format via the SYSLOGGING System Table.
  • The System log is enabled using the SET SYSLOGGING ON Recital/4GL command in the conf/config.db file.
  • Client/Server logs provide detailed information on client/server requests and responses.
  • Client/Server logs are enabled using environment variables, symbols or Registry entries or by specifying the 'logging' parameter when starting the Recital Server.
  • The location of log files is determined by the DB_LOGDIR setting.
  • Versioning of log files is determined by the DB_LOGVER setting.
Published in Blogs
Read more...

sernet.de maintain the latest Samba releases in a yum repository, allowing for an easy and painless install or upgrade of Samba on your yum based Linux distribution.

To install the latest available Samba execute the following commands at the shell:

# cd /etc/yum.repos.d
# wget http://ftp.sernet.de/pub/samba/experimental/centos/5/sernet-samba.repo
# yum install samba

To upgrade an existing Samba install:

# cd /etc/yum.repos.d
# wget http://ftp.sernet.de/pub/samba/experimental/centos/5/sernet-samba.repo
## Note: edit sernet-samba.repo and add the line "gpgcheck=false" otherwise 
## it will not install as it is not signed
# yum update samba

Note: These steps will install the very latest build available at sernet.de.
If you require a less bleeding edge version of Samba, use the "tested" repo. This can be found at the following URL: http://ftp.sernet.de/pub/samba/tested/rhel/5

Published in Blogs
Read more...
Recital 10 introduced the REQUIRE() and REQUIRE_ONCE() statement.

The REQUIRE() statement includes and executes the contents of the specified file at the current program execution level.

When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables, procedures, functions or classes declared in the included file will be available at the current program execution level.

The REQUIRE_ONCE() statement is identical to the REQUIRE() statement except that Recital will check to see if the file as already been included and if so ignore the command.

The full syntax is:
REQUIRE( expC )
REQUIRE_ONCE( expC )

e.g.

REQUIRE_ONCE( "myapp/myglobals.prg" )
Published in Blogs
Read more...
An extremely useful article that describes some firefox undocumented features that allow you to install Firefox XPI And JAR Firefox Add-ons And Themes. 

http://www.universefirefox.com/how-to/how-to-install-xpi-and-jar-firefox-add-ons-and-themes
Published in Blogs
Read more...
Awk is an powerful text processing language that allows you to manipulate files containing columns of data and strings. Awk is extremely useful, both for general operation of Unix commands, and for data transformation.
 
Introduced in Recital 10 is the PIPETOSTR() function (as well as backticks `` inside strings) which can be used  in conjunction with awk to transform recital data.
 
The following links provide good tutorials on awk:
Published in Blogs
Read more...
In Recital 10, you can declare anonymous classes and call anonymous methods in these classes.
// declare some simple procedures 
proc display(cArg)
    echo "display=" + cArg
endproc

proc show(cArg)
    echo "show=" + cArg
endproc

// create an object based on an anonymous class
myobj = new object()

// add some properties
myobj["name"] = "barry"
myobj["company"] = "recital"

// now declare an anonymous method
myobj["mymethod"] = display

// call the method
myobj.mymethod("hello world")    // displays "display=hello world"

// redeclare the method
myobj["mymethod"] = show

// call the method
myobj.mymethod("hello world")    // displays "show=hello world"
Where this becomes particularly useful is when you have a procedure that calls anonymous methods in order to process data. This technique can be used to call anonymous procedures in your code.
proc processdata(oArg)
    oArg.mymethod(oArg.name)    
endproc

proc show(cArg)
    echo "show=" + cArg
endproc

myobj = new object()
myobj["name"] = "barry"
myobj["mymethod"] = show
processdata(myobj)        // displays "show=barry"
Published in Blogs
Read more...

Copyright © 2025 Recital Software Inc.

Login

Register

User Registration
or Cancel