ODBC Driver Users Guide for Microsoft Windows and UNIX Company
Total Page:16
File Type:pdf, Size:1020Kb
PUBLIC SDK for SAP Adaptive Server Enterprise 16.0 SP03 PL07 Document Version: 1.0 – 2019-06-06 ODBC Driver Users Guide for Microsoft Windows and UNIX company. All rights reserved. All rights company. affiliate THE BEST RUN 2019 SAP SE or an SAP SE or an SAP SAP 2019 © 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................................. 18 Executing Prepared SQL Statements............................................19 1.8 Result Sets................................................................ 20 Choosing Cursor Characteristics...............................................21 UseCursor Connection Property............................................... 21 Retrieving Data...........................................................22 Updating and Deleting Rows Through a Cursor.....................................23 Scrollable Cursors.........................................................23 1.9 Calling Stored Procedures......................................................28 1.10 Error Handling..............................................................29 1.11 Datatype Mappings...........................................................31 2 Connections to a Database ...................................................34 2.1 Connection Attributes.........................................................34 2.2 Installing ODBC MetaData Stored Procedures........................................35 2.3 How Connection Parameters Work................................................36 2.4 Character Sets..............................................................37 2.5 ODBC Driver Configuration..................................................... 37 Microsoft Windows........................................................ 38 UNIX..................................................................40 ODBC ini Files............................................................43 2.6 Connections Using a Datasource.................................................44 ODBC Driver Users Guide for Microsoft Windows and UNIX 2 PUBLIC Content Connection Parameters.....................................................44 2.7 ODBC Driver Version Information Utility............................................56 3 SAP ASE Features Supported..................................................57 3.1 Microsecond Granularity for Time Data.............................................58 3.2 Asynchronous Execution for ODBC................................................58 3.3 SAP ASE Cluster Edition Features Supported.........................................59 Login Redirection..........................................................59 Connection Migration...................................................... 60 Connection Failover in Cluster Edition...........................................60 3.4 Distributed Transactions.......................................................63 Programming for Microsoft Distributed Transaction Coordinator (MS DTC).................63 Programming Components Deployed in Sybase EAServer, MTS or COM+..................64 Connection Properties for Distributed Transaction Support............................64 3.5 Directory Services........................................................... 65 LDAP as a Directory Service..................................................65 Using Directory Services.................................................... 66 Enabling Directory Services.................................................. 67 3.6 Bookmark and Bulk Support....................................................69 3.7 Bulk-Load Support...........................................................69 Enabling Bulk Load Using the ODBC Data Source Administrator User Interface.............. 71 Enabling Bulk Load Using the ODBC Connection String...............................72 3.8 Support for data-at-exec in the ODBC Driver.........................................72 3.9 Support for Mainframe Connect and DirectConnect for z/OS Option........................72 ServiceName Configuration Property............................................73 BackEndType Configuration Property........................................... 73 3.10 DSN Migration Tool...........................................................74 Using the Migration Tool.....................................................74 Conversion Switches....................................................... 74 3.11 Password Encryption..........................................................75 Enabling Password Encryption................................................ 76 3.12 Password Expiration Handling...................................................78 3.13 Securely Automate Database Administration Tasks Using Secure User Store..................78 How Does the aseuserstore Utility Work?.........................................79 Enabling Secure User Store for ODBC Client.......................................79 Examples of Creating User Keys for ODBC Clients.................................. 80 3.14 SSL Overview...............................................................80 SSL Security Levels in the ODBC Driver..........................................82 Support for TLS 1.1 and TLS 1.2 in ODBC.........................................82 Validating the Server by its Certificate...........................................83 Enabling SSL Connections...................................................84 3.15 On-demand Command Encryption for SAP ASE Clients.................................86 ODBC Driver Users Guide for Microsoft Windows and UNIX Content PUBLIC 3 ODBC Client and On-demand Command Encryption.................................86 3.16 Multiversion Concurrency Control................................................88 Connection Support in Multiversion Concurrency Control.............................89 ODBC Support...........................................................90 Using IsolationMode Property for ODBC Clients with DSN Connection....................90 3.17 Failover in High Availability Systems...............................................91 Using Failover on Microsoft Windows............................................94 Using Failover on UNIX......................................................94 3.18 Kerberos Authentication.......................................................95 Process Overview......................................................... 95 Requirements............................................................96 Enabling Kerberos Authentication..............................................96 Obtaining an Initial Ticket From the Key Distribution Center............................98 3.19 Logging Without ODBC Driver Manager Tracing......................................100 Log Configuration File......................................................101 Dynamic Logging Support Without ODBC Driver Manager Tracing.......................101 3.20 TDS Protocol Capture........................................................102 Dynamic Control of TDS Protocol Capture....................................... 102 3.21 ODBC Data Batching Without Binding Parameter Arrays................................103 Managing Data Batches....................................................104 Considerations.......................................................... 105 Bulk Insert Support for ODBC Data Batching..................................... 105 3.22 ODBC Deferred Array Binding.................................................. 106 SQLBindColumnDA()......................................................106 SQLBindParameterDA()....................................................107 Usage.................................................................108 3.23 Additional Row Format Information Suppressing.....................................109 3.24 Row Format Meta data Suppressing..............................................109 3.25 Parameter Format Meta data Suppressing ..........................................110 3.26 Releasing Locks at Cursor Close................................................. 111 3.27 select for update Support......................................................111 3.28 Variable-Length Rows in Data-Only Locked Tables.....................................111 3.29 Nonmaterialized Columns....................................................