Documente Academic
Documente Profesional
Documente Cultură
Project Title: OGSA-DAI Document Title: SwisSQL Background Document Identifier: RFC 16 Distribution Classification: DRAFT: OGSA-DAI Internal Authorship: Craig Thomson
Summary
Version
SwisSQL Background
Contents
1 1.1 1.2 1.3 2 3 4 5 6 7 8 Introduction Document Status Notation and Conventions Namespace What is SwisSQL? How can we use the SQLOne API? Which relational resources does it support? Which SQL syntax does it not support? Licensing Summary References 3 3 3 3 4 4 5 5 5 5 6
SwisSQL Background
Introduction
1.3 Namespace
I dont know what namespace this should go in.
SwisSQL Background
What is SwisSQL?
SwisSQL(http://www.swissql.com) is a range of products, created to allow communication and migration between different flavours of SQL database. It is developed by AdventNet(http://www.adventnet.com) an American company. The particular part of SwisSQL of interest to OGSA-DAI, is an API which allows the translation of SQL queries to and from different SQL syntaxes. It is called the SwisSQL, SQLOne API. There are other services provided by AdventNet which allow data migration between different SQL databases and a GUI application for translating SQL queries between different database syntaxes. These all fall under the common name SwisSQL. The SQLOne API comes in two versions, one for Java, and one for C# using .NET. Both versions support the same database types. The Java SQLOne API page is at this time available at: http://www.swissql.com/products/sqlone-apijava/sqlone-apijava.html
The SQLOne API allows two main ways of accessing its functionality. The first is an API available for direct use in our source. It provides access to their SQL conversion engine. The second is a JDBC Wrapper which sits between the code and the database automatically converting SQL queries to the correct format before passing them on to the database specific JDBC driver. Direct API access In order to use this method a new Activity would be required. It would take an SQL query as input and use the SQLOne API to convert the SQL to the appropriate format for the database. The converted SQL would then be output and used for the input of an SQLQuery. This would require a change to the SQLQuery to allow it to accept a query as one of its inputs. To provide an accurate conversion, it is sometimes required to access the input databases metadata. This can be retrieved using the SQLOne API. Advantages: Explicit control of when SQL is converted Allows the output of the conversion to be available on the client side With an activity, the conversion remains within the OGSA-DAI framework The activity abstracts the conversion API so we can change it Disadvantages Client code has to call a conversion activity Have to write a conversion activity Have to change the SQLQuery to allow it to accept queries as input JDBC Wrapper To use the JDBC wrapper, all that is required is to register the JDBC wrapper, connect to the underlying SQL database and then execute the query as you would with any JDBC driver. The wrapper caches the SQL queries it receives to prevent repeated parsing of the same query. Advantages The client code doesnt even need to be aware that a conversion is happening. Less code needs written Disadvantages No control of when a conversion happens Means changing the meaning of the existing SQLQuery No access to the converted query Caching of SQL queries has a memory overhead
SwisSQL Background
The SQLOne API, supports Oracle 8.1.7, 9i, and 10g MS SQL Server 2000 IBM DB2 UDB 8.x Informix 4.x Sybase ASE 12.x MySQL 4.X PostgreSQL 7.x ANSI-SQL - SQL 92 and SQL 99 In particular it supports all of the relational database formats that OGSA-DAI does. I am not sure whether it supports the same version as OGSA-DAI however.
The SQLOne API has a list of supported and unsupported SQL syntax in its help documentation.
Other Issues
6.1 Metadata
The API allows the use of metadata from a source database when converting an SQL query from one dialect to another. This allows implicit information in the query to be correctly converted for use in the target database. If we were to support an activity to translate between two vendor specific databases we would need to provide this metadata.
translated SQL was not necessarily correct. It may be that users of the activity find problems with the translation that are not the fault of the activity we write but are due to inconsistencies in the underlying translation code.
Licensing
Evaluation Licence The SQLOne API is available for a 30 day evaluation period. It is available for download from their website. The evaluation is free. It is distributed in binary form. Full Licence Terms are unknown at this point
Summary
The SwisSQL range provides a number of tools for migrating SQL databases and querying SQL databases in a generic form. The SQLOne API provides a way of converting SQL queries between different dialects of SQL. It does this via a Java (or .NET) API directly accessible from code. It also provides conversion through a JDBC wrapper. In both modes, it supports all the relational databases that OGSA-DAI does. The direct API allows explicit control of conversions, and the JDBC wrapper allows the conversions to occur without the user having to use the API.
SwisSQL Background
References
[1] [2]