Sunteți pe pagina 1din 6
Project Title: OGSA-DAI SwisSQL Background Document Title: SwisSQL Background Document Identifier: RFC 16 Distribution

Project Title: OGSA-DAI

SwisSQL Background

Document Title: SwisSQL Background

Document Identifier: RFC 16

Distribution Classification: DRAFT: OGSA-DAI Internal

Authorship: Craig Thomson

Approval List:

N/A

Distribution List:

OGSA-DAI Team

Document History:

Personnel

Date

Summary

Version

Copyright © The University of Edinburgh, 2006. All rights reserved.

SwisSQL Background

DRAFT: OGSA-DAI Internal

2

Contents

1 Introduction

3

1.1 Document Status

3

1.2 Notation and Conventions

3

1.3 Namespace

3

2 What is SwisSQL?

4

3 How can we use the SQLOne API?

4

4 Which relational resources does it support?

5

5 Which SQL syntax does it not support?

5

6 Licensing

5

7 Summary

5

8 References

6

Copyright © The University of Edinburgh, 2006. All rights reserved.

SwisSQL Background

DRAFT: OGSA-DAI Internal

3

1

Introduction

1.1 Document Status

This short document aims to provide the current High Level System Design view on an OGSA-DAI SwisSQL activity. The purpose of this document is to elicit comment from interested parties within OGSA-DAI and for the detailed design to take place leading towards release 2 and beyond of the OGSA-DAI software. This document will subsequently be absorbed into the High Level System Design document.

1.2 Notation and Conventions

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 [1].

Restrictions in functionality in accordance with the OGSA-DAI release schedule will be denoted by the usage of the boxes.

Release 2 Denotes a restriction in functionality expected for release 2 of OGSA-DAI.

Release 3 Denotes a restriction in functionality expected for release 3 of OGSA-DAI.

In the XML examples, surrounded by frames, elements and attributes that MUST be present are in bold font, those that are optional appear as a normal font.

1.3 Namespace

I don’t know what namespace this should go in.

Copyright © The University of Edinburgh, 2006. All rights reserved.

SwisSQL Background

DRAFT: OGSA-DAI Internal

4

2 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

3 How can we use the SQLOne API?

The SQLOne API allows two main ways of accessing it’s 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 it’s inputs. To provide an accurate conversion, it is sometimes required to access the input database’s 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 doesn’t 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

Copyright © The University of Edinburgh, 2006. All rights reserved.

SwisSQL Background

DRAFT: OGSA-DAI Internal

5

4 Which relational resources does it support?

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.

5 Which SQL syntax does it not support?

The SQLOne API has a list of supported and unsupported SQL syntax in it’s help documentation.

6 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.

6.2 SwisSQL limitations

Another OGSA_DAI document by Alexander Woehrer[2] indicated that the semantics of 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.

7 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

8 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.

Copyright © The University of Edinburgh, 2006. All rights reserved.

SwisSQL Background

DRAFT: OGSA-DAI Internal

6

9

[1]

[2]

References

RFC 2199, http://www.ietf.org/rfc/rfc2119.txt.

OGSA-DAI-SQL99Support.doc, http://localhost:8000/twiki/pub/DAIT/WebHome/OGSA-DAI-SQL99Support.doc

Copyright © The University of Edinburgh, 2006. All rights reserved.