Progress® DataDirect® for for Apache Hive™ JDBC™ User's Guide Release 6.0.1 Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. ThesematerialsandallProgress®softwareproductsarecopyrightedandallrightsarereservedbyProgress SoftwareCorporation.Theinformationinthesematerialsissubjecttochangewithoutnotice,andProgress SoftwareCorporationassumesnoresponsibilityforanyerrorsthatmayappeartherein.Thereferencesinthese materialstospecificplatformssupportedaresubjecttochange. Corticon,DataDirect(anddesign),DataDirectCloud,DataDirectConnect,DataDirectConnect64,DataDirect XMLConverters,DataDirectXQuery,DataRPM,DeliverMoreThanExpected,Icenium,KendoUI,NativeScript, OpenEdge,PoweredbyProgress,Progress,ProgressSoftwareDevelopersNetwork,Rollbase,SequeLink, Sitefinity(andDesign),SpeedScript,StylusStudio,TeamPulse,Telerik,Telerik(andDesign),TestStudio,and WebSpeedareregisteredtrademarksofProgressSoftwareCorporationoroneofitsaffiliatesorsubsidiaries intheU.S.and/orothercountries.Analytics360,AppServer,BusinessEdge,DataDirectSpy,SupportLink, DevCraft,Fiddler,JustAssembly,JustDecompile,JustMock,Kinvey,NativeScriptSidekick,OpenAccess, ProDataSet,ProgressResults,ProgressSoftware,ProVision,PSEPro,Sitefinity,SmartBrowser, SmartComponent,SmartDataBrowser,SmartDataObjects,SmartDataView,SmartDialog,SmartFolder, SmartFrame,SmartObjects,SmartPanel,SmartQuery,SmartViewer,SmartWindow,andWebClientare trademarksorservicemarksofProgressSoftwareCorporationand/oritssubsidiariesoraffiliatesintheU.S. andothercountries.JavaisaregisteredtrademarkofOracleand/oritsaffiliates.Anyothermarkscontained hereinmaybetrademarksoftheirrespectiveowners. PleaserefertothereadmeapplicabletotheparticularProgressproductreleaseforanythird-party acknowledgementsrequiredtobeprovidedinthedocumentationassociatedwiththeProgressproduct. Updated:2018/09/26 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 3 Copyright 4 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 Contents Table of Contents Chapter 1: Welcome to the Progress DataDirect for JDBC for Apache Hive Driver.........................................................................................................13 What's new in this release?..................................................................................................................14 Requirements........................................................................................................................................16 Datasourceanddriverclasses.............................................................................................................17 Connection URL....................................................................................................................................17 Version string information.....................................................................................................................18 Connection properties...........................................................................................................................19 Data types.............................................................................................................................................19 getTypeInfo................................................................................................................................20 Contacting Technical Support...............................................................................................................25 Chapter 2: Getting started...........................................................................27 Datasourceanddriverclasses.............................................................................................................27 Settingtheclasspath............................................................................................................................28 Connecting using the DriverManager...................................................................................................28 Passing the connection URL......................................................................................................28 Testing the connection...............................................................................................................29 Connectingusingdatasources.............................................................................................................32 Howdatasourcesareimplemented...........................................................................................33 Creating data sources................................................................................................................33 Calling a data source in an application......................................................................................34 Testingadatasourceconnection...............................................................................................34 Chapter 3: Using the driver.........................................................................39 Connecting from an application............................................................................................................40 Datasourceanddriverclasses..................................................................................................40 Setting the classpath .................................................................................................................41 ConnectingusingtheDriverManager.........................................................................................41 Connecting using data sources..................................................................................................45 HTTP Mode................................................................................................................................50 Using connection properties.................................................................................................................51 Required properties....................................................................................................................52 User ID/password authentication properties..............................................................................53 Kerberos authentication properties............................................................................................54 Data encryption properties.........................................................................................................55 Data type handling properties....................................................................................................57 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 5 Contents Timeout properties.....................................................................................................................59 Client information properties......................................................................................................59 Statement pooling properties.....................................................................................................60 Additional properties..................................................................................................................61 Performance considerations.................................................................................................................63 Authentication.......................................................................................................................................65 Configuring user ID/password authentication............................................................................65 ConfiguringthedriverforKerberosauthentication.....................................................................66 Data encryption.....................................................................................................................................71 Configuring SSL encryption.......................................................................................................71 ConfiguringSSLserverauthentication.......................................................................................71 Configuring SSL client authentication........................................................................................72 Apache Knox.........................................................................................................................................73 Apache ZooKeeper...............................................................................................................................74 Configuring Apache ZooKeeper for Kerberos authentication....................................................75 Client information..................................................................................................................................76 How databases store client information.....................................................................................77 Returning client information.......................................................................................................78 ReturningMetaDataaboutclientinformationlocations..............................................................78 IP addresses.........................................................................................................................................79 Parameter metadata support................................................................................................................79 Insertandupdatestatements.....................................................................................................80 Select statements.......................................................................................................................80 Stored procedures......................................................................................................................80 ResultSet metadata support.................................................................................................................81 Isolation levels......................................................................................................................................81 Unicode support....................................................................................................................................81 Error handling.......................................................................................................................................82 Large object support.............................................................................................................................82 Batch inserts ........................................................................................................................................83 Rowset support.....................................................................................................................................83 Timeouts...............................................................................................................................................83 Views.....................................................................................................................................................84 SQL escape sequences........................................................................................................................84 Using scrollable cursors........................................................................................................................84 RestrictionsforApacheHivefunctionality.............................................................................................84 Connection Pool Manager....................................................................................................................85 Howconnectionpoolingworks...................................................................................................85 ImplementingDataDirectconnectionpooling.............................................................................87 Configuringtheconnectionpool.................................................................................................90 Connecting using a connection pool..........................................................................................91 Closing the connection pool.......................................................................................................92 Checking the Pool Manager version..........................................................................................92 Enabling Pool Manager tracing..................................................................................................93 Connection Pool Manager interfaces.........................................................................................93 6 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 Contents Statement Pool Monitor........................................................................................................................98 UsingDataDirect-specificmethodstoaccesstheStatementPoolMonitor...............................99 UsingJMXtoaccesstheStatementPoolMonitor...................................................................101 Importing statements into a statement pool.............................................................................103 Clearing all statements in a statement pool.............................................................................103 Freezingandunfreezingthestatementpool............................................................................104 Generating a statement pool export file...................................................................................104 DataDirectStatementPoolMonitorinterfacesandclasses.....................................................104 DataDirect Test...................................................................................................................................106 DataDirect Test tutorial.............................................................................................................107 Tracking JDBC calls with DataDirect Spy...........................................................................................139 Enabling DataDirect Spy..........................................................................................................139 Chapter 4: Connection property descriptions ........................................143 AccountingInfo....................................................................................................................................147 ApplicationName.................................................................................................................................148 ArrayFetchSize...................................................................................................................................149 ArrayInsertSize...................................................................................................................................150 AuthenticationMethod.........................................................................................................................151 BatchMechanism................................................................................................................................152 BinaryDescribeType............................................................................................................................152 CatalogMode.......................................................................................................................................153 ClientHostName..................................................................................................................................154 ClientUser...........................................................................................................................................154 ConnectionRetryCount........................................................................................................................155 ConnectionRetryDelay........................................................................................................................156 ConvertNull.........................................................................................................................................157 CookieName.......................................................................................................................................157 CryptoProtocolVersion........................................................................................................................158 DatabaseName...................................................................................................................................159 EnableCookieAuthentication...............................................................................................................160 EncryptionMethod ..............................................................................................................................161 HostNameInCertificate........................................................................................................................162 HTTPPath...........................................................................................................................................163 ImpersonateUser................................................................................................................................164 ImportStatementPool..........................................................................................................................164 InitializationString................................................................................................................................165 InsensitiveResultSetBufferSize...........................................................................................................166 JavaDoubleToString............................................................................................................................167 KeyPassword......................................................................................................................................167 KeyStore.............................................................................................................................................168 KeyStorePassword.............................................................................................................................169 LoginConfigName...............................................................................................................................170 LoginTimeout......................................................................................................................................170 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 7 Contents MaxBinarySize....................................................................................................................................171 MaxPooledStatements........................................................................................................................172 MaxStringSize.....................................................................................................................................173 Password............................................................................................................................................173 PortNumber.........................................................................................................................................174 ProgramID...........................................................................................................................................175 QueryTimeout.....................................................................................................................................175 RegisterStatementPoolMonitorMBean................................................................................................176 RemoveColumnQualifiers...................................................................................................................177 ServerName........................................................................................................................................178 ServicePrincipalName.........................................................................................................................179 SpyAttributes.......................................................................................................................................180 StringDescribeType.............................................................................................................................181 TransactionMode................................................................................................................................182 TransportMode....................................................................................................................................182 TrustStore...........................................................................................................................................183 TrustStorePassword............................................................................................................................184 UseCurrentSchema............................................................................................................................185 User.....................................................................................................................................................186 ValidateServerCertificate.....................................................................................................................186 ZooKeeperDiscovery .........................................................................................................................187 ZooKeeperNamespace ......................................................................................................................188 Chapter 5: Troubleshooting......................................................................191 Troubleshooting your application........................................................................................................191 Turning on and off DataDirect Spy logging..............................................................................192 DataDirectSpylogexample.....................................................................................................192 Troubleshooting connection pooling...................................................................................................194 Enabling tracing with the setTracing method...........................................................................194 PoolManagertracefileexample..............................................................................................195 Troubleshooting statement pooling.....................................................................................................198 GeneratinganexportfilewiththeexportStatementmethod....................................................199 Statementpoolexportfileexample..........................................................................................199 Configuring logging.............................................................................................................................199 Using the JVM for logging........................................................................................................200 Chapter 6: Supported SQL Functionality and Extensions ....................201 Datadefinitionlanguage(DDL)...........................................................................................................202 Columnnamequalification..................................................................................................................202 From clause........................................................................................................................................202 Group By clause.................................................................................................................................203 Having clause ....................................................................................................................................203 Order By clause..................................................................................................................................203 8 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 Contents For Updateclause...............................................................................................................................203 Set Operators......................................................................................................................................204 Subqueries..........................................................................................................................................204 SQL Expressions................................................................................................................................204 Constants.................................................................................................................................205 Numeric operators....................................................................................................................205 Character operator...................................................................................................................205 Relational operators.................................................................................................................205 Logical operators......................................................................................................................206 Functions..................................................................................................................................206 Restrictions.........................................................................................................................................208 Update restrictions...................................................................................................................208 Stored procedures....................................................................................................................208 Views........................................................................................................................................208 Other restrictions......................................................................................................................209 Chapter 7: SQL escape sequences for JDBC..........................................211 Date, time, and timestampescape sequences...................................................................................212 Scalar functions..................................................................................................................................212 Outer join escape sequences.............................................................................................................213 LIKEescapecharactersequenceforwildcards..................................................................................214 Procedure call escape sequences......................................................................................................214 Chapter 8: JDBC support..........................................................................215 Array....................................................................................................................................................216 Blob.....................................................................................................................................................217 CallableStatement...............................................................................................................................218 Clob.....................................................................................................................................................229 Connection..........................................................................................................................................230 ConnectionEventListener....................................................................................................................235 ConnectionPoolDataSource................................................................................................................236 DatabaseMetaData.............................................................................................................................236 DataSource.........................................................................................................................................244 Driver...................................................................................................................................................245 ParameterMetaData............................................................................................................................245 PooledConnection...............................................................................................................................247 PreparedStatement.............................................................................................................................247 Ref.......................................................................................................................................................252 ResultSet.............................................................................................................................................252 ResultSetMetaData.............................................................................................................................263 RowSet................................................................................................................................................264 SavePoint............................................................................................................................................264 Statement............................................................................................................................................264 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1 9 Contents StatementEventListener......................................................................................................................268 Struct...................................................................................................................................................268 XAConnection.....................................................................................................................................269 XADataSource....................................................................................................................................269 XAResource........................................................................................................................................269 Chapter 9: JDBC extensions.....................................................................271 UsingJDBCwrappermethodstoaccessJDBCextensions...............................................................272 DatabaseMetaData interface..............................................................................................................272 DDBulkLoad interface.........................................................................................................................273 ExtConnection interface......................................................................................................................280 ExtDatabaseMetaData interface.........................................................................................................285 ExtLogControl class............................................................................................................................285 Chapter10:DesigningJDBCapplicationsforperformanceoptimization.287 Using database metadata methods....................................................................................................288 Minimizingtheuseofdatabasemetadatamethods.................................................................288 Avoiding search patterns..........................................................................................................289 Using a dummy query to determine table characteristics........................................................289 Returning data....................................................................................................................................290 Returning long data..................................................................................................................290 Reducing the size of returned data..........................................................................................291 Choosing the right data type....................................................................................................291 Retrievingresultsets................................................................................................................291 SelectingJDBCobjectsandmethods................................................................................................292 Usingparametermarkersasargumentstostoredprocedures................................................292 UsingthestatementobjectinsteadofthePreparedStatementobject.....................................292 Usingbatchesinsteadofpreparedstatements........................................................................293 Choosing the right cursor.........................................................................................................294 Using get methods effectively..................................................................................................294 Retrieving auto-generated keys...............................................................................................295 Managing connections and updates...................................................................................................295 Managing connections.............................................................................................................296 Managing commits in transactions...........................................................................................296 Choosingtherighttransactionmodel.......................................................................................297 Using updateXXX methods......................................................................................................297 Using getBestRowIdentifier......................................................................................................297 Glossary.......................................................................................................299 10 Progress®DataDirect®forJDBC™forApacheHive™:User'sGuide:Version6.0.1
Description: