Connectors for RAD Studio by CData
“Look at the world like it is a database”
Integration is a very vast topic and it can take many different forms but it almost always relies on a certain "interface". This sets how you can communicate with an external program. For the often used applications and systems we are talking about API (Application Programming Interface). Simply said, it is nothing but functions or protocols through which the system can be given commands or exchanged data with.
Especially for business applications, a communication and a data sharing with other systems and applications is often quite important. Usually, individual systems are responsible for a particular area of datas (like CRM for customer data, accounting software for economic data, etc.), and their connection reduces the risk that the information will be hold duplicated and not consistent (“more versions of a truth” problem). There is a common requirement for linking with an email, calendar or applications from Microsoft Office Suite.
It can be quite time-consuming to get familiar with the architecture, internal structure or an application interface of an external system. Larger and more complicated system means even more complex and more complicated API. You also can’t ignore some differences between different installed versions.
These and other reasons have led Embarcadero company to work with leading provider of data access and application integration solutions, CData Software. CData specialises on drivers development or connectors development for access to a huge amount of application, databases and application interfaces. CData business connectors use native protocols and APIs for accessing external systems. Regardless of a system type, virtual data structures are created which are then accessible by technologies such as ODBC, JDBC, ADO.NET and others. So any supported system or application seems like a standard database source which can be communicated with using SQL in eyes of developers. Thus a need to study new protocols or interfaces which are still being developed and changed falls aways. Especially for development environments such as Delphi and C++Builder a package of drivers for using with FireDAC technology was created (and is still being expanded).
An example of an easy application
As an external system we are going to use email service Seznam which is for free and thus everybody can try an interconnection.
Create a new VCL project (library FireMonkey is supported as well, although so far only for Win32 and Win64) and insert components FDConnection, FDTable, FDGUIxWaitCursor, DataSource and DBGrid into a form.
Realization of connection to the email server (or to any other system) is provided by FDConnection component to which we have to give necessary parameters. To do so we use Connection Editor. We open it either by double-click on FDConnection component or by a right-click and choosing Connection Editor. First we have to select a driver (Driver ID) which in our case is CData.Email.
Based on a chosen driver the parameters which are required for establishing connection or which adjust its properties will be loaded. Correctness of inserted values can be checked by pressing “Test” button.
Now we change settings for component FDTable which is connected to FD Connection and so we only have to decide which virtual table we are going to use as a data source. Choose CData.Inbox table and set a property Active of FDTable component to “True”.
We then continue in a standard way. As DataSet of DataSource component we set component FDTable. We then refer property DataSource of component DBGrid to DataSource1 and thus displaying datas will happen. A basic part of our application is done.
Inserting dataSo now we know how to obtain data from an external system. But what about a case when you want to do more than just read the data? As we have already said, tables we were working with are only virtual and they don’t say anything about a real structure of the system. Especially with more complex systems it isn’t generally speaking easy to insert data into a table. There can be a lot of internal connection and solid restrictions.
In the example with email server it’s quite obvious that just by inserting an entry into a “sent mails” table the entry won’t be sent. A solution is quite easy. Just like virtual tables, CData drivers create a package of saved procedures as well. All you have to do is add the component FDStoredProcedure and connect it to already defined FDConnection. In Object Inspector choose a procedure (based on operation you want to do) which in case of sending an email is CData.SendMailMessage).
In order to run the procedure, all required parameters have to handed to it. Usually a saved procedures has both input and output parameters. They allow us to check whether an operation finished successfully. In case of an email we get an identifier of a sent message back as a return value. The same way you can work with any supported system of application. Description of attributes of tables and procedures can be found in documentation at http://www.cdata.com/kb/help/.
LicensingYou can choose between two packages called Enterprise and Enterprise+. Eneterprise package currently offers 45 drivers for popular business systems in fields such as economics, accounting, CRM or ERP. You can find here also connectors for cloud services, payment systems, data formats or social networks. Enterprise+ package extends of number of connectors to over 80.
Where can you get a trial version?Users of Delphi, C++Builder or RAD Studio 10.2 Tokyo can for a limited time try CData’s connectors for free. Installation of individual drivers is available in “GetIt Package Manager” which can be launched right from a development environment (Tools -> GetIt). In order to find the driver you want faster you can use filtering (there’s even a cathegory “Connectors”) or searching. They you just launch the installation of your desired driver by pressing “INSTALL” button.
Why CData:- Connectors offer simplicity, a steep learning curve and unified access for all supported systems and applications - you can handle them quickly and effortlessly
- It allows you to communicate with external systems and applications without a need for deeper a study of their interfaces
- Connectors offer both access to data and the ability to run external system actions
- ANSI-92 SQL language is used as the programming language here
- Connectors are available as common drivers for FireDAC technology is commonly used by a majority of developers
- Favourable price and a huge amount of supported systems
About the Author
Petr Houfembt biz s.r.o.
Web: Embt.cz