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.
The gateway can be specified in several formats: |
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; }
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
http://msdn.microsoft.com/en-us/library/cc351024(VS.85).aspx
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.
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.
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
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.
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!"
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)