SQL Anywhere® Server Programming

Total Page:16

File Type:pdf, Size:1020Kb

SQL Anywhere® Server Programming SQL Anywhere® Server Programming June 2008 Version 11.0.0 Copyright and trademarks Copyright © 2008 iAnywhere Solutions, Inc. Portions copyright © 2008 Sybase, Inc. All rights reserved. This documentation is provided AS IS, without warranty or liability of any kind (unless provided by a separate written agreement between you and iAnywhere). You may use, print, reproduce, and distribute this documentation (in whole or in part) subject to the following conditions: 1) you must retain this and all other proprietary notices, on all copies of the documentation or portions thereof, 2) you may not modify the documentation, 3) you may not do anything to indicate that you or anyone other than iAnywhere is the author or source of the documentation. iAnywhere®, Sybase®, and the marks listed at http://www.sybase.com/detail?id=1011207 are trademarks of Sybase, Inc. or its subsidiaries. ® indicates registration in the United States of America. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Contents About this book ........................................................................................... ix About the SQL Anywhere documentation ................................................................ x I. Introduction to Programming with SQL Anywhere ................................ 1 1. SQL Anywhere data access programming interfaces ......................................... 3 SQL Anywhere .NET API ....................................................................................... 4 SQL Anywhere OLE DB and ADO APIs ................................................................ 5 ODBC API .............................................................................................................. 6 JDBC API ............................................................................................................... 7 SQL Anywhere embedded SQL ............................................................................ 8 SQL Anywhere Perl DBI API ................................................................................. 9 SQL Anywhere Python Database API ................................................................. 10 SQL Anywhere PHP API ..................................................................................... 11 SQL Anywhere web services ............................................................................... 12 Sybase Open Client API ...................................................................................... 13 2. SQL Anywhere Explorer ....................................................................................... 15 Introduction to the SQL Anywhere Explorer ........................................................ 16 Using the SQL Anywhere Explorer ...................................................................... 17 3. Using SQL in applications .................................................................................... 21 Executing SQL statements in applications .......................................................... 22 Preparing statements ........................................................................................... 24 Introduction to cursors ......................................................................................... 27 Working with cursors ........................................................................................... 30 Choosing cursor types ......................................................................................... 37 SQL Anywhere cursors ........................................................................................ 39 Describing result sets .......................................................................................... 56 Controlling transactions in applications ............................................................... 58 4. Three-tier computing and distributed transactions ........................................... 63 Introduction to three-tier computing and distributed transactions ........................ 64 Three-tier computing architecture ........................................................................ 65 Using distributed transactions .............................................................................. 68 Using EAServer with SQL Anywhere ................................................................... 70 Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 iii SQL Anywhere® Server - Programming II. Java in the database .............................................................................. 73 5. Java support in SQL Anywhere ........................................................................... 75 Introduction to Java support ................................................................................ 76 Java in the database Q & A ................................................................................. 78 Java error handling .............................................................................................. 82 The runtime environment for Java in the database ............................................. 83 6. Tutorial: Using Java in the database ................................................................... 87 Introduction to Java in the database tutorial ........................................................ 88 Installing Java classes into a database ............................................................... 95 Special features of Java classes in the database ................................................ 99 Starting and stopping the Java VM .................................................................... 103 Unsupported Java classes ................................................................................. 104 III. SQL Anywhere Data Access APIs ..................................................... 105 7. SQL Anywhere .NET Data Provider ................................................................... 107 SQL Anywhere .NET Data Provider features .................................................... 108 Running the sample projects ............................................................................. 109 Using the .NET Data Provider in a Visual Studio project ................................... 110 Connecting to a database .................................................................................. 112 Accessing and manipulating data ...................................................................... 115 Using stored procedures .................................................................................... 132 Transaction processing ...................................................................................... 134 Error handling and the SQL Anywhere .NET Data Provider .............................. 136 Deploying the SQL Anywhere .NET Data Provider ........................................... 137 Tracing support .................................................................................................. 139 8. Tutorial: Using the SQL Anywhere .NET Data Provider ................................... 143 Introduction to the .NET Data Provider tutorial .................................................. 144 Using the Simple code sample .......................................................................... 145 Using the Table Viewer code sample ................................................................ 148 9. Tutorial: Developing a simple .NET database application with Visual Studio ....................................................................................................................... 153 Lesson 1. Create a table viewer ........................................................................ 154 Lesson 2. Add a synchronizing data control ...................................................... 158 10. SQL Anywhere .NET 2.0 API Reference .......................................................... 163 iv Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 SQL Anywhere® Server - Programming iAnywhere.Data.SQLAnywhere namespace (.NET 2.0) .................................... 164 iAnywhere.SQLAnywhere.Server namespace (.NET 2.0) ................................. 422 11. SQL Anywhere OLE DB and ADO APIs ........................................................... 425 Introduction to OLE DB ...................................................................................... 426 ADO programming with SQL Anywhere ............................................................ 427 Setting up a Microsoft Linked Server using OLE DB ......................................... 434 Supported OLE DB interfaces ........................................................................... 435 12. SQL Anywhere ODBC API ................................................................................ 441 Introduction to ODBC ......................................................................................... 442 Building ODBC applications ............................................................................... 444 ODBC samples .................................................................................................. 449 ODBC handles ................................................................................................... 450 Choosing an ODBC connection function ........................................................... 453 SQL Anywhere connection attributes ................................................................ 456

  1044
Recommended publications
  • SQL Anywhere Introduction Company
    PUBLIC SQL Anywhere Document Version: 17 – 2020-12-11 SQL Anywhere Introduction company. All rights reserved. All rights company. affiliate THE BEST RUN 2020 SAP SE or an SAP SE or an SAP SAP 2020 © Content 1 SQL Anywhere - Introduction...................................................3 1.1 SQL Anywhere 17 Outside the Data Center...........................................5 1.2 Database Scenarios...........................................................6 Desktop Applications and Embedded Databases.................................... 6 Client/Server Applications....................................................7 Web Applications...........................................................8 Remote Data Synchronization..................................................8 1.3 Editions and Licensing......................................................... 9 1.4 Separately Licensed Components.................................................9 1.5 Supported Platforms..........................................................10 1.6 Accessibility................................................................11 1.7 Data Management Technologies..................................................16 SQL Anywhere and UltraLite Target Platforms......................................17 Multi-Tier Computing Architecture..............................................18 ETL Features.............................................................18 1.8 Overview of Data Exchange Technologies............................................19 Challenges for Synchronization
    [Show full text]
  • SQL Anywhere: an Embeddable DBMS
    SQL Anywhere: An Embeddable DBMS Ivan T. Bowman Peter Bumbulis Dan Farrar Anil K. Goel Brendan Lucier Anisoara Nica G. N. Paulley John Smirnios Matthew Young-Lai Sybase iAnywhere Abstract We present an overview of the embeddability features of SQL Anywhere, a full-function relational data- base system designed for frontline business environments with minimal administration. SQL Anywhere supports features common to enterprise-class database management systems, such as intra-query par- allelism, materialized views, OLAP functionality, stored procedures, triggers, and hot failover. SQL Anywhere can serve as a high-performance workgroup server, an embedded database that is installed along with an application, or as a mobile database installed on a handheld device that provides full database services, including two-way synchronization, to applications when the device is disconnected from the corporate intranet. We illustrate how SQL Anywhere’s embeddability features work in concert to provide a robust data management solution in zero-administration environments. 1 Introduction Database systems have become ubiquitous across the computing landscape. This is partly because of the basic facilities offered by database management systems: physical data independence, ACID transaction properties, a high-level query language, stored procedures, and triggers. These facilities permits sophisticated applications to ‘push’ much of their complexity into the database itself. The proliferation of database systems in the mobile and embedded market segments is due, in addition to the features above, to the support for two-way database replication and synchronization offered by most commercial database management systems. Data synchroniza- tion technology makes it possible for remote users to both access and update corporate data at a remote, off-site location.
    [Show full text]
  • Mac Os X Database Application
    Mac Os X Database Application Splashy Moses always degum his Politburo if Barr is unprovident or unswathing but. Corny Ashton enervating hinderingly or evite ergo when Weylin is faceless. Butcherly Maurits sometimes cognizes his alodiums hard and rebelled so submissively! New platform for the next section names of your data source you to It tedious really disappointing the heir that amount has been zero progress with this issue, could this time. Also many question are using databases on their Macs such as. Expert users may configure the ODBC. This application that you. Check the app from zero progress with a tabbed format of applications that this, transforming raw data! DBeaver Community Free Universal Database Tool. Provide the administrator username and password. You exhibit even export your bay as an html-table and print labels. Understanding at precious glance. Best Database Management Software for Mac 2021 Reviews. What does Texas gain for not selling electricity across state lines and therefore avoiding Federal Power and oversight? Take this open snaptube will get into chartable form at first mac os x application functioning of your experience with live without using app. Transform all kinds of files into optimized for various displays PDFs with water motion. However, four of the defining features of this crime is it it comes with native TLS encryption to ensure that important business success never gets into these wrong hands. Get stomp to legal one million creative assets on Envato Elements. Fuzzee allows to mac os application has been easier for free file to the appropriate odbc data synchronization tool.
    [Show full text]
  • SAP IQ Cockpit Non-GUI Administration and Monitoring Company
    Administration Guide | PUBLIC SAP IQ 16.1 SP 04 Document Version: 1.0.0 – 2020-10-15 SAP IQ Cockpit Non-GUI Administration and Monitoring company. All rights reserved. All rights company. affiliate THE BEST RUN 2021 SAP SE or an SAP SE or an SAP SAP 2021 © Content 1 SAP IQ Cockpit Non-GUI Administration and Monitoring..............................9 2 Get Started with SAP IQ Cockpit............................................... 10 2.1 Start and Stop the SAP IQ Cockpit Server...........................................10 Starting and Stopping the SAP IQ Cockpit Server in Windows...........................11 Starting and Stopping the SAP IQ Cockpit Server in UNIX............................. 12 Configuring SAP IQ Cockpit Server as a Windows Service..............................13 Configuring SAP IQ Cockpit Server as a UNIX Service................................ 15 cockpit Command.........................................................16 3 Configure SAP IQ Cockpit.................................................... 20 3.1 Configure SQL-Based Monitoring.................................................20 3.2 Configure SQL-Based Exploring..................................................21 3.3 Configure SQL-Based Alerting................................................... 21 Download and Start an SAP SQL Anywhere Client...................................21 Create a Technical User for Alerting.............................................23 Configure the Email Server for Alerting.......................................... 24 3.4 Configure the
    [Show full text]
  • Veritas Netbackup™ Opscenter Administrator's Guide
    Veritas NetBackup™ OpsCenter Administrator's Guide Windows and Linux Release 9.0 Veritas NetBackup™ OpsCenter Administrator's Guide Last updated: 2020-12-10 Legal Notice Copyright © 2020 Veritas Technologies LLC. All rights reserved. Veritas, the Veritas Logo, and NetBackup are trademarks or registered trademarks of Veritas Technologies LLC or its affiliates in the U.S. and other countries. Other names may be trademarks of their respective owners. This product may contain third-party software for which Veritas is required to provide attribution to the third party (“Third-party Programs”). Some of the Third-party Programs are available under open source or free software licenses. The License Agreement accompanying the Software does not alter any rights or obligations you may have under those open source or free software licenses. Refer to the Third-party Legal Notices document accompanying this Veritas product or available at: https://www.veritas.com/about/legal/license-agreements The product described in this document is distributed under licenses restricting its use, copying, distribution, and decompilation/reverse engineering. No part of this document may be reproduced in any form by any means without prior written authorization of Veritas Technologies LLC and its licensors, if any. THE DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Veritas Technologies LLC SHALL NOT BE LIABLE FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS DOCUMENTATION.
    [Show full text]
  • SQL Anywhere® 16 Introduction
    SQL Anywhere® 16 Introduction Version 16.0 February 2013 Copyright © 2013, SAP AG or an SAP affiliate company. - SAP Sybase SQL Anywhere 16.0 Version 16.0 February 2013 © 2013 SAP AG or an SAP affiliate company. All rights reserved. You may use, print, reproduce, and distribute this documentation (in whole or in part) subject to the following conditions: 1) you must retain this and all other proprietary notices, on all copies of the documentation or portions thereof, 2) you may not modify the documentation, 3) you may not do anything to indicate that you or anyone other than SAP is the author or source of the documentation. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark. Contents About this book ....................................................................................
    [Show full text]
  • ODBC Driver Users Guide for Microsoft Windows and UNIX Company
    PUBLIC SDK for SAP Adaptive Server Enterprise 16.0 SP03 PL06 Document Version: 1.0 – 2019-1-15 ODBC Driver Users Guide for Microsoft Windows and UNIX company. All rights reserved. All rights company. affiliate THE BEST RUN 2018 SAP SE or an SAP SE or an SAP SAP 2018 © Content 1 ODBC Programming..........................................................5 1.1 ODBC Requirements and Supported Platforms........................................5 1.2 ODBC Conformance...........................................................6 1.3 ODBC Driver Manager..........................................................7 Building Applications Using an ODBC Driver Manager.................................8 Building Applications Without Using an ODBC Driver Manager...........................9 1.4 ODBC Driver for SAP ASE Samples................................................11 1.5 ODBC Handles.............................................................. 11 Allocating an ODBC Handle...................................................13 1.6 Connections to a Datasource ....................................................13 ODBC Connection Functions..................................................14 Establishing an ODBC Connection..............................................15 Threads and Connections in ODBC Applications....................................16 1.7 SQL Statements Execution..................................................... 16 Executing a SQL Statement in an ODBC Application................................. 17 Executing SQL Statements With Bound Parameters................................
    [Show full text]
  • Installation Guide Sybase IQ Infoprimer 15.3 DOCUMENT ID: DC01642-01-1530-01 LAST REVISED: May 2011 Copyright © 2011 by Sybase, Inc
    Installation Guide Sybase IQ InfoPrimer 15.3 DOCUMENT ID: DC01642-01-1530-01 LAST REVISED: May 2011 Copyright © 2011 by Sybase, Inc. All rights reserved. This publication pertains to Sybase software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845. Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Sybase trademarks can be viewed at the Sybase trademarks page at http://www.sybase.com/detail?id=1011207. Sybase and the marks listed are trademarks of Sybase, Inc. ® indicates registration in the United States of America. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
    [Show full text]
  • Installation Guide
    Installation Guide Adaptive Server Enterprise 12.5 Sun Solaris DOCUMENT ID: 35889-01-1250-02 LAST REVISED: February 2002 Copyright © 1989-2002 by Sybase, Inc. All rights reserved. This publication pertains to Sybase database management software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845. Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Sybase, the Sybase logo, ADA Workbench, Adaptable Windowing Environment, Adaptive Component Architecture, Adaptive Server, Adaptive Server Anywhere, Adaptive Server Enterprise, Adaptive Server Enterprise Monitor, Adaptive Server Enterprise Replication, Adaptive Server Everywhere, Adaptive Server IQ, Adaptive Warehouse, AnswerBase, Anywhere Studio, Application Manager, AppModeler,
    [Show full text]
  • Installation Guide Table of Contents
    PUBLIC PowerBuilder 12.6 Document Version: 2.0 - 2014-10-27 Installation Guide Table of Contents 1 Installation Guide............................................................3 2 Installation Workflow.........................................................4 3 Planning Your Installation..................................................... 5 3.1 Installation Media Contents......................................................5 3.2 System Requirements......................................................... 5 3.3 Obtaining a License........................................................... 6 3.3.1 SySAM Troubleshooting.................................................7 3.4 Software Requirements........................................................ 9 4 Preinstallation Tasks........................................................ 12 5 Starting the Common Setup Program............................................13 6 Providing Basic Information...................................................15 7 Installing SQL Anywhere......................................................17 7.1 About SQL Anywhere......................................................... 18 8 Installing InfoMaker.........................................................19 8.1 InfoMaker Components....................................................... 20 9 Installing PowerBuilder ......................................................21 9.1 PowerBuilder Components.....................................................22 10 Completing the Setup Program................................................24
    [Show full text]
  • Genesys Interactive Insights Deployment Guide
    Genesys Interactive Insights Deployment Guide What BO/BI Components Must I Install? 9/29/2021 Contents • 1 What BO/BI Components Must I Install? • 1.1 Prerequisites to BI Software Installation • 1.2 Required BI Components • 1.3 Installing BI software • 1.4 Setting up the BI Environment Genesys Interactive Insights Deployment Guide 2 What BO/BI Components Must I Install? What BO/BI Components Must I Install? SAP BusinessObjects (BO) software is an optional component of Genesys Info Mart, but is required for the operation of Genesys Interactive Insights (GI2). Refer to SAP BusinessObjects Business Intelligence Platform 4 (BI 4.1) documentation for additional installation and upgrade instructions. Access BO/BI Documentation from the following sources: • From the SAP BusinessObjects Business Intelligence Platform Documentation CD. • If you are a direct SAP customer, from the SAP website. • If you obtained BI software through Genesys, from the SAP website. GI2 does not require all available BI components: this page describes only those components that are required for GI2 operation. Prerequisites to BI Software Installation Prior to beginning the installation of BI 4.x, ensure that you have met the following prerequisites: • Acquire the appropriate installation package, which is provided either directly from SAP or from Genesys. • Ensure that no prior BI software versions pre-exist on your host. If you have a prior version of BI 4.x installed, you should upgrade it, rather than install it anew. Refer to the relevant BI 4.x Update Guide for instructions. • Ensure that your operating system is a supported version. Supported platforms are described in BI documentation.
    [Show full text]
  • Mobilink Getting Started
    MobiLink Getting Started Published: March 2007 Copyright and trademarks Copyright © 2007 iAnywhere Solutions, Inc. Portions copyright © 2007 Sybase, Inc. All rights reserved. iAnywhere Solutions, Inc. is a subsidiary of Sybase, Inc. iAnywhere grants you permission to use this document for your own informational, educational, and other non-commercial purposes; provided that (1) you include this and all other copyright and proprietary notices in the document in all copies; (2) you do not attempt to "pass-off" the document as your own; and (3) you do not modify the document. You may not publish or distribute the document or any portion thereof without the express prior written consent of iAnywhere. This document is not a commitment on the part of iAnywhere to do or refrain from any activity, and iAnywhere may change the content of this document at its sole discretion without notice. Except as otherwise provided in a written agreement between you and iAnywhere, this document is provided “as is”, and iAnywhere assumes no liability for its use or any inaccuracies it may contain. iAnywhere®, Sybase®, and the marks listed at http://www.ianywhere.com/trademarks are trademarks of Sybase, Inc. or its subsidiaries. ® indicates registration in the United States of America. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All other company and product names mentioned may be trademarks of the respective companies with which they are associated. Contents About This Manual ..................................................................................... vii SQL Anywhere documentation ............................................................................... viii Documentation conventions ..................................................................................... xi Finding out more and providing feedback .............................................................
    [Show full text]