Recital

Login Register

In this article Barry Mavin, CEO and Chief Software Architect for Recital provides details on how to use the Recital Universal .NET Data Provider with the Recital Database Server.

Overview

A data provider in the .NET Framework serves as a bridge between an application and a data source. A data provider is used to retrieve data from a data source and to reconcile changes to that data back to the data source.

Each .NET Framework data provider has a DataAdapter object: the .NET Framework Data Provider for OLE DB is the OleDbDataAdapter object, the .NET Framework Data Provider for SQL Server is the SqlDataAdapter object, the .NET Framework Data Provider for ODBC is the OdbcDataAdapter object, and the .NET Framework Data Provider for the Recital Database Server is the RecitalDataAdapter object.

The Recital Universal .NET Data Provider can access any data sources supported by the Recital Database Server. It is not restricted to only access Recital data. It can be used to access server-side ODBC, JDBC and OLE DB data sources also.

Core classes of the Data Provider

The Connection, Command, DataReader, and DataAdapter objects represent the core elements of the .NET Framework data provider model. The Recital Universal .NET Data Provider is plug compatible with the .NET Framework Data Provider for SQL Server. All SQL Server classes are prefixed with "Sql" e.g. SqlDataAdaptor. To use the Recital Universal Data Adaptor, simply change the "Sql" prefix to "Recital" e.g. RecitalDataAdaptor.

The following table describes these objects.

Object Description
RecitalConnection Establishes a connection to a specific data source.
RecitalCommand Executes a command against a data source.
RecitalDataReader Reads a forward-only, read-only stream of data from a data source.
RecitalDataAdapter Populates a DataSet and resolves updates with the data source.

Along with the core classes listed in the preceding table, a .NET Framework data provider also contains the classes listed in the following table.


Object Description
RecitalTransaction Enables you to enlist commands in transactions at the data source.
RecitalCommandBuilder A helper object that will automatically generate command properties of a DataAdapter or will derive parameter information from a stored procedure and populate the Parameters collection of a Command object.
RecitalParameter Defines input, output, and return value parameters for commands and stored procedures.

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 .NET Data Provider supports a connection string format that is similar to the SQL Server connection string format.

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

The following table lists the valid names for keyword values within the ConnectionString property of the RecitalConnection class.


Name Default Description
Data Source
-or-
Server
-or-
Servername
-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
-or-
uid
-or-
User
-or-
Username
  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


Populating a DataSet from a DataAdaptor

The ADO.NET DataSet is a memory-resident representation of data that provides a consistent relational programming model independent of the data source. The DataSet represents a complete set of data including tables, constraints, and relationships among the tables. Because the DataSet is independent of the data source, a DataSet can include data local to the application, as well as data from multiple data sources. Interaction with existing data sources is controlled through the DataAdapter.

A DataAdapter is used to retrieve data from a data source and populate tables within a DataSet. The DataAdapter also resolves changes made to the DataSet back to the data source. The DataAdapter uses the Connection object of the .NET Framework data provider to connect to a data source and Command objects to retrieve data from and resolve changes to the data source.

The SelectCommand property of the DataAdapter is a Command object that retrieves data from the data source. The InsertCommand, UpdateCommand, and DeleteCommand properties of the DataAdapter are Command objects that manage updates to the data in the data source according to modifications made to the data in the DataSet.

The Fill method of the DataAdapter is used to populate a DataSet with the results of the SelectCommand of the DataAdapter. Fill takes as its arguments a DataSet to be populated, and a DataTable object, or the name of the DataTable to be filled with the rows returned from the SelectCommand.

The Fill method uses the DataReader object implicitly to return the column names and types used to create the tables in the DataSet, as well as the data to populate the rows of the tables in the DataSet. Tables and columns are only created if they do not already exist; otherwise Fill uses the existing DataSet schema.

Examples in C#:
////////////////////////////////////////////////////////////////////////
// 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 Southwind database 
// and populates a DataTable in a DataSet with the list of customers. 
// The SQL statement and Connection arguments passed to the DataAdapter 
// constructor are used to create the SelectCommand property of the DataAdapter.
public DataSet SelectCustomers()
{
	RecitalConnection swindConn = new
		RecitalConnection("Data Source=localhost;Initial Catalog=southwind");
	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;
}

////////////////////////////////////////////////////////////////////////
// The following example uses the RecitalCommand, RecitalDataAdapter and 
// RecitalConnection, to select records from a database, and populate a 
// DataSet with the selected rows. The filled DataSet is then returned. 
// To accomplish this, the method is passed an initialized DataSet, a 
// connection string, and a query string that is a SQL SELECT statement
public DataSet SelectRecitalRows(DataSet dataset, string connection, string query) 
{
	RecitalConnection conn = new RecitalConnection(connection);
	SqlDataAdapter adapter = new RecitalDataAdapter();
	adapter.SelectCommand = new RecitalCommand(query, conn);
	adapter.Fill(dataset);
	return dataset;
}
Published in Blogs
Read more...

 

Key features of the Recital scripting language include:

What are the key feature of the Recital database?

  • High performance database application scripting language
  • Modern object-oriented language features
  • Easy to learn, easy to use
  • Fast, just-in-time compiled
  • Develop desktop or web applications
  • Cross-platform support
  • Extensive built-in functions
  • Superb built-in SQL command integration
  • Navigational data access for the most demanding applications
Published in Blogs
Read more...
This MSDN article provides good details about IE CSS compatibility issues.
http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx
 
Published in Blogs
Read more...

There is a good article on the gluster website here which gives some good information regarding file system optimization suitable for a HA Recital cluster solution.

Published in Blogs
Read more...
TIP
The Compatibility Dialog settings are written to the compat.db file in <path>/conf - please ensure that the user setting the compatibility settings has write access to this file and directory.  Once these settings are written, the dialog will not be displayed unless SET COMPATIBLE is issued.

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.0 introduced the COPY DATABASE <name> TO <name> command.. The full syntax is;
COPY DATABASE <name> TO <name>  [ IF [ NOT ] EXISTS ] 
This command is used to copy an existing database to a new database. By default an error will be returned if the target database already exists. Specifying the optional IF NOT EXISTS keywords no error will be returned if the target database already exists. If the optional IF EXISTS keywords are specified and the target database already exists, then it will be removed before the copy. Both the databases must be closed before they can be copied.
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...

Here is a simple shell script to copy your ssh authorization key to a remote machine so that you can run ssh and scp without having to repeatedly login.

#!/bin/sh
# save in file ssh_copykeyto.sh then chmod +x ssh_copykeyto.sh
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "create it with "ssh-keygen -t rsa" before running this script
exit
fi
if [ -z $1 ];then
echo "Bad args: specify user@host as the first argument to this script"
exit
fi
echo "Copying ssh authorization key to $1... "
KEYCODE=`cat $KEY`
ssh -q $1 "mkdir ~/.ssh 2>/dev/null; chmod 700 ~/.ssh; echo "$KEYCODE" >> ~/.ssh/authorized_keys; \ chmod 644 ~/.ssh/authorized_keys"
echo "done!"
Published in Blogs
Read more...

STRERROR()

Syntax

STRERROR( [ <expN> ] )

Description

The STRERROR() function returns a string describing the last operating system error message. If the optional error number is specified then the related operating system error message will be returned.

Example

mqdes=mqcreate("/myqueue", 2)
 if (mqdes < 0)
     messagebox(strerror()+",errno="+alltrim(str(error())))
    return
 endif
 rc = mqsend(mqdes, "Test message")
 if (rc < 0)
     messagebox(strerror()+",errno="+alltrim(str(error())))
    return
 endif
 mqclose(mqdes)

Published in Blogs
Read more...
Twitter

Copyright © 2024 Recital Software Inc.

Login

Register

User Registration
or Cancel