Getting Started With Purequery V Rodrigues Et Al Download
Getting Started With Purequery V Rodrigues Et Al Download
download
https://ebookbell.com/product/getting-started-with-purequery-v-
rodrigues-et-al-4091240
https://ebookbell.com/product/getting-started-with-natural-language-
processing-final-release-1st-edition-ekaterina-kochmar-46078164
https://ebookbell.com/product/getting-started-with-uno-platform-and-
winui-3-handson-building-of-crossplatform-desktop-mobile-and-web-
applications-that-can-run-anywhere-1st-edition-andrew-
hoefling-46364362
https://ebookbell.com/product/getting-started-with-secure-embedded-
systems-alexandru-radovici-47255148
Getting Started With Visual Studio 2022 Learning And Implementing New
Features 2nd Dirk Strauss
https://ebookbell.com/product/getting-started-with-visual-
studio-2022-learning-and-implementing-new-features-2nd-dirk-
strauss-47378260
Getting Started With Microsoft Viva An End User Guide To Business
Transformation 1st Edition Darce Hess
https://ebookbell.com/product/getting-started-with-microsoft-viva-an-
end-user-guide-to-business-transformation-1st-edition-darce-
hess-47554262
Getting Started With Forex Trading Using Python Beginners Guide To The
Currency Market And Development Of Trading Algorithms 1st Edition Alex
Krishtop
https://ebookbell.com/product/getting-started-with-forex-trading-
using-python-beginners-guide-to-the-currency-market-and-development-
of-trading-algorithms-1st-edition-alex-krishtop-48054962
https://ebookbell.com/product/getting-started-with-angular-create-and-
deploy-angular-applications-1st-edition-victorhugogarcia-48081270
Getting Started With Python Data Analysis Phuong Voth Martin Czygan
https://ebookbell.com/product/getting-started-with-python-data-
analysis-phuong-voth-martin-czygan-49052760
Getting Started With Bluetooth Low Energy Tools And Techniques For
Lowpower Networking Kevin Townsend
https://ebookbell.com/product/getting-started-with-bluetooth-low-
energy-tools-and-techniques-for-lowpower-networking-kevin-
townsend-50195590
GETTING STARTED WITH
pureQuery
A book for the community by the community
FIRST EDITION
4 Getting Started with pureQuery
IBM may not offer the products, services, or features discussed in this document in other countries.
Consult your local IBM representative for information on the products and services currently available
in your area. Any reference to an IBM product, program, or service is not intended to state or imply
that only that IBM product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may be used instead.
However, it is the user's responsibility to evaluate and verify the operation of any non-IBM product,
program, or service.
IBM may have patents or pending patent applications covering subject matter described in this
document. The furnishing of this document does not grant you any license to these patents. You can
send license inquiries, in writing, to:
For license inquiries regarding double-byte character set (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
This information could include technical inaccuracies or typographical errors. Changes are
periodically made to the information herein; these changes will be incorporated in new editions of the
publication. IBM may make improvements and/or changes in the product(s) and/or the program(s)
described in this publication at any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do
not in any manner serve as an endorsement of those Web sites. The materials at those Web sites
are not part of the materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
6 Getting Started with pureQuery
The licensed program described in this document and all licensed material available for it are
provided by IBM under terms of the IBM Customer Agreement, IBM International Program License
Agreement or any equivalent agreement between us.
Any performance data contained herein was determined in a controlled environment. Therefore, the
results obtained in other operating environments may vary significantly. Some measurements may
have been made on development-level systems and there is no guarantee that these measurements
will be the same on generally available systems. Furthermore, some measurements may have been
estimated through extrapolation. Actual results may vary. Users of this document should verify the
applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their
published announcements or other publicly available sources. IBM has not tested those products and
cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM
products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of
those products.
All statements regarding IBM's future direction or intent are subject to change or withdrawal without
notice, and represent goals and objectives only.
This information contains examples of data and reports used in daily business operations. To
illustrate them as completely as possible, the examples include the names of individuals, companies,
brands, and products. All of these names are fictitious and any similarity to the names and addresses
used by an actual business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate
programming techniques on various operating platforms. You may copy, modify, and distribute these
sample programs in any form without payment to IBM, for the purposes of developing, using,
marketing or distributing application programs conforming to the application programming interface
for the operating platform for which the sample programs are written. These examples have not been
thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability,
serviceability, or function of these programs. The sample programs are provided "AS IS", without
warranty of any kind. IBM shall not be liable for any damages arising out of your use of the sample
programs.
References in this publication to IBM products or services do not imply that IBM intends to make
them available in all countries in which IBM operates.
If you are viewing this information softcopy, the photographs and color illustrations may not
appear.
Trademarks
IBM, the IBM logo, DB2, z/OS, Optim, and ibm.com are trademarks or registered trademarks of
International Business Machines Corp., registered in many jurisdictions worldwide. Other product and
service names might be trademarks of IBM or other companies. A current list of IBM trademarks is
available on the Web at “Copyright and trademark information” at
www.ibm.com/legal/copytrade.shtml.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States,
other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries,
or both.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
Other company, product, or service names may be trademarks or service marks of others.
9
Table of Contents
Preface ............................................................................................................................. 17
Who should read this book? ........................................................................................ 17
How is this book structured? ........................................................................................ 17
A book for the community ............................................................................................ 18
Conventions ................................................................................................................. 19
What’s next? ................................................................................................................ 19
About the Authors........................................................................................................... 21
Contributors .................................................................................................................... 23
Acknowledgements ........................................................................................................ 24
PART I – OVERVIEW AND SETUP ................................................................................. 25
Chapter 1 - Introduction to pureQuery.......................................................................... 27
1.1 The big picture: What is pureQuery? ..................................................................... 27
1.1.1 What’s in a name? .......................................................................................... 28
1.1.2 What do we mean by platform? ...................................................................... 29
1.2 pureQuery application programming interfaces ..................................................... 30
1.3 pureQuery runtime ................................................................................................. 31
1.4 pureQuery application development environment ................................................. 33
1.5 pureQuery monitoring services .............................................................................. 35
1.6 Career path ............................................................................................................ 38
1.7 The pureQuery community .................................................................................... 38
1.7.1 Popular community Web sites ........................................................................ 39
1.8 Competitive products ............................................................................................. 40
1.9 Exercises ............................................................................................................... 42
1.10 Review Questions ................................................................................................ 42
Chapter 2 - Installing pureQuery (Optim Development Studio) ................................. 45
2.1 Installation: The big picture .................................................................................... 45
2.2 Installation prerequisites ........................................................................................ 46
2.3 Installing Optim Development Studio..................................................................... 47
2.3.1 Installing from the launchpad .......................................................................... 48
2.3.2 Applying Optim Development Studio Fixpack 1 ............................................. 54
2.4 Running Optim Development Studio ..................................................................... 55
2.4.1 Adding pureQuery support to projects ............................................................ 55
2.5 Summary................................................................................................................ 58
2.6 Exercise ................................................................................................................. 58
2.7 Review Questions .................................................................................................. 59
PART II – TOOLING ......................................................................................................... 61
Chapter 3 - Code generation and customized Java Editor Integration ..................... 65
3.1 pureQuery Tooling: The big picture ....................................................................... 65
3.1.1 Generating pureQuery code ........................................................................... 66
3.2 Overview of the different types of wizards for code generation within the pureQuery
tooling........................................................................................................................... 70
10 Getting Started with pureQuery
6.6 Processing the pureQueryXml file with the Configure utility ................................ 116
6.6.1 Specifying options for the Configure utility ................................................... 117
6.6.2 Statement sets in pureQueryXml files .......................................................... 118
6.6.3 DDL statements ............................................................................................ 120
6.6.4 Files with the .org extension ....................................................................... 121
6.6.5 Running the Configure utility......................................................................... 121
6.6.6 In practice: Configure the pureQueryXml file that was captured .................. 122
6.7 Binding the SQL statements in the pureQueryXml file ........................................ 122
6.7.1 In practice: Bind the SQL statements in your pureQueryXml file ................. 122
6.8 Running an application while specifying a pureQueryXml file ............................. 126
6.8.1 Static execution ............................................................................................ 126
6.8.2 Captured-only execution ............................................................................... 126
6.8.3 Replacing SQL statements with alternate statements .................................. 127
6.8.4 SQL literal substitution .................................................................................. 127
6.8.5 Capturing during execution ........................................................................... 127
6.8.6 In practice: Run the Human Resources Manager application while specifying
the pureQueryXml file ............................................................................................ 127
6.9 Specifying alternate SQL statements for execution ............................................. 127
6.10 SQL Literal substitution ...................................................................................... 129
6.10.1 Advantages of parameterized SQL statements .......................................... 129
6.10.2 How to use pureQuery SQL literal substitution........................................... 130
6.11 Locating SQL statements in your application .................................................... 131
6.12 Aspects of JDBC application that may cause problems during static execution132
6.13 Advanced features ............................................................................................. 132
6.14 Summary ............................................................................................................ 134
6.15 Review questions ............................................................................................... 134
6.16 Exercise ............................................................................................................. 136
Chapter 7 - The StaticBinder Utility............................................................................. 137
7.1 The StaticBinder utility: The big picture ............................................................... 137
7.2 Binding from interfaces and pureQueryXml files ................................................. 138
7.2.1 Binding from interfaces ................................................................................. 138
7.2.2 Binding from pureQueryXml files .................................................................. 139
7.3 Specifying options for the StaticBinder utility ....................................................... 141
7.4 Specifying interfaces and pureQueryXml files in an archive file .......................... 142
7.5 Running the StaticBinder utility in IBM Optim Development Studio .................... 142
7.6 Running the StaticBinder utility from the command line ...................................... 146
7.6.1 Specifying database connection information ................................................ 146
7.6.2 Specifying the interfaces and pureQueryXml files ........................................ 147
7.6.3 Specifying additional options ........................................................................ 149
7.6.4 Example commands for the StaticBinder utility ............................................ 149
7.7 Advanced features ............................................................................................... 150
7.8 Summary.............................................................................................................. 151
7.9 Review questions ................................................................................................. 151
7.10 Exercise ............................................................................................................. 153
12 Getting Started with pureQuery
10.5.2 Executing an SQL statement with generated keys one time by using the
method: ROW update (String sql, Class<ROW> returnClass, String[]
columnNames, Object... parameters) ..................................................... 198
10.5.3 Executing an SQL statement multiple times ............................................... 200
10.5.4 In practice: Execute an SQL statement that modifies the database -- Complete
the "Change Employee Information" screen .......................................................... 201
10.6 Advanced features ............................................................................................. 202
10.7 Summary ............................................................................................................ 203
10.8 Review questions ............................................................................................... 203
10.9 Exercise ............................................................................................................. 205
Chapter 11 - Annotated-Method Programming Style ................................................ 207
11.1 Annotated-method Programming Style: The big picture................................... 207
11.2 Annotated-method interfaces............................................................................. 210
11.2.1 In practice: Overview of the “In practice” sections in this chapter .............. 210
11.2.2 In practice: Observe the HumanResourcesData interface....................... 211
11.2.3 In practice: Create an instance of an interface of annotated methods in the
displayLogin() method.................................................................................... 211
11.3 Generating an implementation class for an interface of annotated methods .... 212
11.3.1 Specifying options to the pureQuery Generator ......................................... 212
11.3.2 Generating an implementation class in Optim Development Studio .......... 215
11.4 Annotated methods ............................................................................................ 215
11.4.1 Declaring the return type ............................................................................ 217
11.4.2 In practice: Execute a simple SELECT statement that uses cursor attributes --
Complete the “Company Employees” screen ........................................................ 219
11.5 Executing SQL statements that have parameters ............................................. 221
11.5.1 In practice: Specify a scalar as a parameter to an SQL statement -- Complete
the “Login” screen .................................................................................................. 223
11.5.2 In practice: Specify a pureQuery bean as a parameter to an SQL statement--
Complete the “Employee Information” screen ....................................................... 225
11.5.3 Special case scenarios for parameter types............................................... 227
11.6 Executing SQL statements that modify information in a database .................... 228
11.6.1 Retrieving generated keys .......................................................................... 228
11.6.2 In practice: Execute an SQL statement that modifies the database -- Complete
the "Change Employee Information" screen .......................................................... 229
11.7 Tooling Support for Annotated Methods and Generated Code ......................... 231
11.7.1 Generating XML file to override the SQL statements in interfaces ............ 231
11.7.2 EMFT JET template customization for code generation ............................ 232
11.8 Using static SQL with annotated-method style applications .............................. 233
11.8.1 Binding the SQL statements in the interfaces ............................................ 234
11.8.2 Running an annotated-method style application in STATIC execution mode
............................................................................................................................... 236
11.9 Advanced features ............................................................................................. 238
11.10 Summary.......................................................................................................... 238
11.11 Review questions ............................................................................................. 239
14 Getting Started with pureQuery
Preface
Keeping your skills current in today's world is becoming increasingly challenging. There are
too many new technologies being developed, and little time to learn them all. The DB2®
on Campus Book Series has been developed to minimize the time and effort required to
learn many of these new technologies. The content of this book is based in the features
available in the version 2.2.0.1 of IBM® Optim™ Development Studio and IBM Optim
pureQuery Runtime. At the time this book was ready for publishing, new features of
pureQuery became generally available. For more information about these new features,
refer to the “What’s New?” page in this link:
https://www-304.ibm.com/support/docview.wss?uid=swg27016961
Before reading this book, it is recommended that you have some familiarity or knowledge
regarding topics addressed by the following books, also part of the DB2 on Campus Book
Series:
main components: API, runtime, tooling and monitoring services. Chapter 2 covers
installation of IBM’s pureQuery.
• Part II covers the pureQuery tooling, available as part of IBM’s Optim Development
Studio product.
• Part III takes a step back and describes how pureQuery supports the broader
goals of security, performance and insight for new and existing Java™ and JDBC
applications. It covers topics such as client optimization for new and existing
applications and monitoring tools which give the application centric DBA insight
into layers of the runtime stack they have never been able to monitor before.
• Part IV digs into the internals of pureQuery. This part starts with Chapter 9, which
covers in detail the existing persistence and Object-relational mapping frameworks
and positions pureQuery among them. The next chapters describe the API,
runtime and monitoring services of pureQuery
• Part V covers pureQuery best practices and the integration of pureQuery with
existing technologies and frameworks.
Exercises are provided in selected chapters. Most chapters contain review questions to
help you learn the material; answers to those questions are included in Appendix A.
A sample application is also provided with this book and described in Chapter 4. The
source code for the application, as well as code samples developed throughout the book,
can be found in the provided zip file GettingStartedWithPureQuery.zip
accompanying this book.
Conventions
Many examples of commands, SQL statements, and code are included throughout the
book. Specific keywords are written in uppercase bold. For example: A NULL value
represents an unknown state. Commands are shown in lowercase bold. For example: The
dir command lists all files and subdirectories on Windows®. SQL statements are shown
in upper case bold. For example: Use the SELECT statement to retrieve information from a
table.
Object names used in our examples are shown in bold italics. For example: The flights
table has five columns.
Italics are also used for variable names in the syntax of a command or statement. If the
variable name has more than one word, it is joined with an underscore. For example:
CREATE TABLE table_name
What’s next?
In addition to the books in the section “Who should read this book?", we recommend you to
review the following books in the DB2 on Campus book series for more details about
related topics:
The following figure shows all the different eBooks in the DB2 on Campus book series
available for free at ibm.com/db2/books
20 Getting Started with pureQuery
Zeus Courtois is a Software Engineer at the IBM Silicon Valley Lab working on Optim
Development Studio for the the pureQuery tooling team. Previously, as an intern within
IBM, held positions in the Technical Enablement Team for DB2 pureXML and Data Studio.
Zeus has a bachelors degree in Computer Science and a Masters of Science in
Information Systems from Texas A&M Int'l University. Zeus has co-authored several
articles for the pureQuery tooling in IBM developerWorks.
Heather Lamb is a software engineer at IBM in Herndon, Virginia. She worked for three
years as a developer for the IBM Optim pureQuery Runtime and Optim Performance
Manager Extended Insight products. Currently she is a technical consultant with IBM’s
Global Business Services. Her subject of expertise is software development. She
previously worked as a software developer on IBM’s JDBC and SQLJ Driver, and spent
three years as a communications officer in the United States Air Force. She holds a
master’s degree in Computer Science from Stanford University.
Christina Sheets works as a software engineer for IBM. She is one of the developers of
the Optim pureQuery Runtime software. She attended the University of Florida, where she
received a master's degree in Computer Engineering, as well as a bachelor's degree in
Computer Science and Mathematics. Christina lives with her husband in California. In her
free time, she helps with various ministries at her church.
22 Getting Started with pureQuery
Kathryn Zeideinstein is a member of the Optim Solutions technical enablement team and
has responsibility for community building and communications with the technical
community. She has many years of experience with IBM starting out as an Information
Developer for DB2 for z/OS®, managing the SQL Standards team, managing editor for the
Information Management zone on developerWorks and as product manager and marketing
manager for several Information Management products. She has authored or co-authored
numerous article on developerWorks and in other publications, including topics ranging
from business intelligence to content analytics. She led the team the produced the DB2 On
Campus book Getting Started with Data Studio for DB2. Kathy holds a master’s degree in
Professional Writing from Illinois State University.
Contributors 23
Contributors
The following people edited, reviewed, provided content, and contributed significantly to
this book.
Acknowledgements
We greatly thank the following individuals for their assistance in developing materials
referenced in this book:
Anshul Dawra for his guidance on pureQuery runtime for the tooling team.
Sonali Surange, for her guidance on the pureQuery tooling chapters and her several IBM
developerWorks articles that were a guide to the tooling chapters in this book.
Fay Wand et al, for the IBM developerWorks article “Integrating JPA and pureQuery:
Leveraging DB2 static execution for the Java Persistence API”.
Rafael Coss for his assistance in finding external reviewers for this book.
How pureQuery can optimize database access, improve developer productivity, and
help DBAs gain insight into the database interactions of applications
Web sites where you can get more information and join a community
In this section, we’ll define pureQuery as a platform and explain what we mean by that.
We’ll also go over the components of that platform and then discuss how aspects of the
platform get delivered to the public as software products. Note that although pureQuery
capabilities are strongest in support of Java application environments, there are benefits
from pureQuery to other environments such as .NET, and those benefits are planned to
grow over time.
28 Getting Started with pureQuery
Because you may be familiar with the term pureXML® from what you’ve read in Getting
Started with DB2 Express-C, it’s interesting to get a little background on how this data
access platform ended up with the name pureQuery. Stephen Brodsky, an IBM
Distinguished Engineer in the IBM Optim organization, in one of his blog entries, says it
best:
So how did this platform get the name pureQuery? It didn’t start out that way (as is
often the case with new products or technologies). We had two internal code
names for the project, Data Zero (because it’s the data access layer for Project
Zero) and JLinQ, because it compares very favorably with Microsoft®'s LINQ
initiative (all the power of database access without having to change the C# and
Visual Basic languages – we achieved all the major features of LINQ but stayed
pure standard Java™). pureQuery embraces the full database access without
watering down the SQL or database capabilities. It avoids least common
denominator approaches that dilute the ability to access what you really need in a
database and integrates all aspects of the life cycle in both runtime and tooling,
"Pure" means no compromises and first class Java-SQL-database integration.
As the project moved closer to release, it was time to choose a name. Because the
project represented application plus database integration at what we feel is the
best, truest form, without all the mess that sometimes bogs software down, early
users called it "pure data access" or "pure data query (PDQ)." The pure concept,
and the PDQ acronym, really resonated with the marketing team (the same team
that named pureXML), and the pureQuery name was born. [2]
It’s important to note here that since Steve wrote that blog entry, a subset of pureQuery
benefits have been extended beyond Java data access, including to .NET, and by the time
this book is published, CLI. The focus of this Getting Started book is on the support for
Java environments.
Chapter 1 – Introduction to pureQuery 29
pureQuery consists of the facets shown in Figure 1.1, which can be used as needed for
any particular project or task and which are delivered in specific products related to those
tasks.
Application programming interfaces (APIs), built for ease of use and for
simplifying the use of best practices for enhanced database performance when
using Java.
When compared with JDBC, the pureQuery APIs allow developers to build applications
with far less handwritten code yet still with greater control over database access than
provided by many object-relational frameworks.
pureQuery directly utilizes SQL for relational database access, in-memory collections, and
XML, so developers do not need to learn a new query language.
The pureQuery API provides both inline SQL and Java annotated method styles of
programming. Both styles are designed to be significantly easier to use than JDBC. Each
style has its advantages depending on the use case. For more details on choosing a style,
see Chapter 15.
The inline style is similar to JDBC in that the SQL is defined within the Java code as a
string object, however unlike JDBC, pureQuery supports an editing environment that is
SQL aware, and pureQuery’s content assist makes it easy to add accurate, error-free SQL.
Inline style also provides a variety of methods which implement common database access
patterns to provide value over JDBC. The inline style is described further in Chapter 5.
In the annotated method style, described in Chapter 6, the SQL is provided as separate
annotations and is invoked via Java methods, as part of a user-defined interface. The
annotated method style (also known as method style) has some advantages. It shields the
application from specific interface implementations, which means you can switch to another
persistence technology if needed without changing your program. Also, with method style,
your application can use static SQL when accessing DB2 databases once it has been
bound, with a simple switch of a runtime flag, which means developers can develop and
Chapter 1 – Introduction to pureQuery 31
test their applications using dynamic SQL, and with no additional changes, that same
application can be bound and take advantage of the performance, security, and stability of
static SQL execution (described in Appendix D).
Note:
If you are not familiar with static SQL and the benefits of using it, see Appendix D or the
article entitled No excuses database programming for Java at
ibm.com/developerworks/data/library/dmmag/DBMag_2008_Issue2/NoExcusesDB/
The pureQuery APIs are designed with Web 2.0 in mind -- custom result handlers map
results to plain old Java objects (POJOs), XML, or JavaScript Object Notation (JSON).
Figure 1.2 - pureQuery works with a wide variety of new or existing applications
For both pureQuery applications and for those that are written using a framework, the
pureQuery runtime captures the application SQL and related metadata for use by
developers or DBAs to share, review, analyze, optimize, revise, and restrict SQL execution.
There are a few extra steps involved to gathering this information in a process called client
optimization, which is described further in Chapter 9.
If the target database is DB2, the captured SQL can be bound into packages for static
execution to improve performance, enhance security, improve manageability, and reduce
costs.
Chapter 1 – Introduction to pureQuery 33
Client optimization enhances OpenJPA applications, just like JDBC applications, in a wide
variety of environments. However Open JPA applications on WebSphere Application
Server V7 or later releases that are accessing DB2 can take advantage of enhanced
integrations with pureQuery runtime to quickly get those applications up and running
using static SQL and heterogeneous batching capability when accessing DB2 data, without
requiring client optimization steps. You can find out more about this capability in Chapter
16.
For .NET applications that access DB2, use the Optim pureQuery Runtime to enable a
command-line-based capture and bind of dynamically running SQL statements to improve
performance, security, and manageability.
Note:
This e-book is focused on Java, but if you’re interested in the capabilities that exist for
.NET, see the developerWorks tutorial entitled Optimizing your existing .NET applications
using pureQuery here:
http://www.ibm.com/developerworks/data/tutorials/dm-0903optimizenet/
Figure 1.3 - Optim Development Studio provides enhanced tools for Java database
access development and tuning
As shown in Figure 1.3, you can visualize linkages among the Java source code,
the SQL (generated or not), and the database objects themselves to speed up
problem isolation and dependency analysis. An important benefit of this capability is
helping DBAs speak to developers in a language developers understand. This is
important in real world environments in which developers are often insulated from
the SQL that gets issued to the database when object-relational mapping tools are
used.
Chapter 1 – Introduction to pureQuery 35
As shown in Figure 1.3, analyze potential SQL performance “hotspots” quickly and
easily directly from your desktop.
Collaborate with peers to review and optimize application SQL. You can launch
Optim Query Tuner, a separately available product, directly from the development
environment to get expert tuning advice for DB2.
Show SQL errors in the Java editor automatically without having to execute the
application as shown in the partial screenshot below in Figure 1.4.
Run the application’s SQL without having to execute the application, even if it
contains parameters -- just point and click
Generate a data access layer for common operations (create, read, update, delete
(CRUD)) without writing code
Optim Development Studio includes a copy of the pureQuery runtime for use on your
workstation. Use Optim Development Studio on its own to build better Java applications
more quickly, or combine it seamlessly with other Eclipse-based tools you may need, such
as Data Studio, Optim Database Administrator, InfoSphere™ Data Architect, or Rational®
Application Developer for WebSphere Software.
For DBAs, there are even more statistics being gathered and displayed in Optim
Performance Monitor using the Extended Insight Feature that help them understand the
activity in the software stack across the database client, the application server, and the
network.
Before pureQuery, insight into the Java driver stack and the ability to see what line of a
Java application was executing SQL was unavailable for DBAs. Traditional database
monitoring tools listen on the server side only. They watch and report events that happen
inside the database server, e.g. buffer pool hits, cache hits, lock contention, etc. But they
have no insight into how the details of the Java application itself affected the database
time, the amount of time spent in the network, the connection pool in the application server,
and so on.
Why is that a problem? Because, without a unified view across the stack, it is hard for a
DBA to tell where the problem resides. The application says it issued the query so it must
be the database server’s problem. So the DBA is often the one trying to figure out where
the problem is and/or working with the network administrator, the systems administrator,
and the application developer comparing notes and traces to isolate the issue.
This capability provides a fundamental shift from traditional monitoring. Now DBAs have an
end-to-end database monitoring solution for a complete view of performance across the
database client, the application server, the database server, and the network between
them. And that information can be displayed in graphs and charts for easy identification of
misbehaving transactions.
• Monitor performance indicators that better reflect end user experience and
proactively detect negative trends in:
• See where workloads, transactions, and SQL requests spend their time across the
database client, the application server, the database server, and the network
between them.
38 Getting Started with pureQuery
• Isolate problems to the correct layer in the stack, including visibility into database
related performance indicators in WebSphere application servers
With these insights, problems that took days to isolate before can now be found in minutes.
The problems can be solved by one person, rather than having to route a problem from
DBA to net admin, to AIX and WAS admin, to developer, just to try to gather enough
information and skills to investigate every layer of the stack.
Application developers who use the pureQuery API can build applications that run both on
DB2 (and which can easily be converted to static SQL for optimized applications) and on
Informix Dynamic Server and Oracle databases. Additional databases are planned to be
added to this list over time. And the process to optimize existing Java applications using
client optimization is supported across all those databases.
In addition, the emphasis on performance in the development cycle with pureQuery will
help application developers grow database and query tuning skills that can help them grow
to a DBA or specialized query tuning position.
A great resource is the Integrated Data Management community space (Figure 1.6) that
aggregates links to downloads, forums, blogs (such as the Integrated Data Management
experts blog), technical articles, videos, and more, in a single location at
http://www.ibm.com/developerworks/spaces/optim.
When you go to the community space, you will see a variety of portlets that contain links to
forums, videos, and more. There is a tab on the space that includes links to all downloads,
including Optim Development Studio, which contains the pureQuery runtime for
development use on your workstation. And there is a tab with links to many existing
articles and tutorials on using pureQuery capabilities as delivered in the Optim product
family.
40 Getting Started with pureQuery
Finally, the pureQuery platform page on ibm.com provides a resource to keep you current
on pureQuery products, benefits, performance, and FAQs.
http://www.ibm.com/software/data/optim/purequery-platform/
Figure 1.7 positions Java data access technologies on a continuum from those on the left
that are very data-centric, that is, for developers who want and need more control over the
data access code, to those on the right, that provide ease-of-use features for object-
oriented programmers but which provide generally less control over what SQL is
generated. The right side of the continuum often provides slower data access
performance.
Because coding in JDBC is so tedious, it only makes sense that Java developers would
turn to frameworks such as Spring, iBatis (now called myBatis), and JPA to help with their
object-relational mapping, among other things. pureQuery does provide productivity boosts
that many are looking for in a Java framework, but it does not provide the full persistence
or container management associated with Hibernate or JPA. As a framework alternative,
pureQuery attempts to provide a balance point between enhanced productivity and full
SQL control.
However, pureQuery is different from other frameworks in that it can complement any
existing framework. Developers can continue to use their framework of choice and add
pureQuery to get the added benefits of performance enhancement, improved security, and
improved manageability. Integrations with other frameworks are described in Part V.
Of course, if you are writing new applications and don’t require full container management,
then pureQuery is an excellent choice in terms of performance and productivity when your
data is stored in DB2, Informix Dynamic Server, or Oracle databases.
As shown in the figure above, pureQuery attempts to provide the best of both worlds:
It gives the developer the ability to fully control the SQL where needed
It helps the developer create good SQL without having to learn a new query
language
As mentioned earlier, pureQuery can use client optimization to take any existing Java
application, even if coded in a framework, and “uplift” it so that those applications can
obtain many of the same benefits they would get when coding to the pureQuery APIs,
notably static SQL and enhanced visualization for improved problem determination. The
client optimization technology can help regardless of whether your application is a
complicated Hibernate application or an out-of-the-box Java/JDBC program for which you
may not even have the source code.
42 Getting Started with pureQuery
1.9 Exercises
We will use this first exercise to ensure your environment is ready to install Optim
Development Studio and to ensure you have all the required software downloaded for
future exercises. Follow these instructions:
1. Ensure your computer is using one of the supported Windows or Linux operating
systems as described in this technote: http://www-
01.ibm.com/support/docview.wss?rs=4014&uid=swg27015710
2. Download Optim Development Studio. If you do not already own it, you can
download a 30-day trial from:
http://www.ibm.com/developerworks/downloads/im/datastudiodev/. If you are a
university student, your university may have an academic license to use it – if not,
use the trial version above. You will learn how to install the product in Chapter 2.
3. If you don’t already have DB2, you can download DB2 Express-C. We will use the
free version of DB2, DB2 Express-C, for the examples used in this book. To
download the latest version of DB2 Express-C, click this link and choose the
appropriate file to download for the operating system you are using.
4. Explore the Optim Development Studio and pureQuery information topics, which
are located in the Integrated Data Management Information Center at this location.
2. True or false: pureQuery client monitoring capabilities are only of value to DBAs?
Why or why not?
5. What is the name of the capability that enables existing Java, .Net, or CLI
applications to take advantage of pureQuery static SQL execution capabilities?
A. Data Studio
A. Data Studio
D. Generate data access layer for create, read, update, and delete operations
10. Which of the following database servers cannot be accessed using pureQuery at
the time of publication?
A. Oracle
For an overview of the IBM Installation Manager package, refer to the book Getting Started
with Data Studio for DB2, Chapter 3.
The installation process for Optim Development Studio requires one of the following web
browsers: Microsoft Internet Explorer 6 SP1, Mozilla 1.6 or 1.7, and Firefox 2.0 or higher.
For the latest information on Optim Development Studio system requirements, review the
product’s web page: http://www.ibm.com/software/data/optim/development-studio/
2. Select a language and then click OK. The Welcome screen comes up. In the left
pane, select Install Product as shown in Figure 2.4.
Chapter 2 – Installing pureQuery (Optim Development Studio) 49
Figure 2.5 - Install both Installation Manager and Data Studio packages
After accepting the license, click Next. You will then be presented with a screen that lets
you specify the location directory for shared resources and for Installation Manager itself.
You can keep the defaults; however, you’ll want to take note of the fact that you should
choose a drive with more space than you think you need just for Optim Development
Studio in case you decide to shell-share with other Eclipse-based products in the future,
4. As shown in Figure 2.6, take the default and then click Next.
Another Random Scribd Document
with Unrelated Content
ollut enää enempää kuin puolet, 500 miestä, jäljellä. Nämät eivät
ajan pitkään riittäneet puolustamaan linnaa niin suurta ylivoimaa
vastaan. Liettualaiset pääsivät vihdoin väkirynnäköllä vallinrikon läpi
ja levisivät ympäri kaupunkia, tappaen kaikki, mikä eteen sattui.
Rosen viimeisten miestensä kanssa vetäytyi erääseen torniin. Mutta
siinäkin oli pitempi vastarinta mahdoton, se oli silminnähtävää;
antautuminen oli myös hänen mielestänsä yhtä mahdotonta, koska
se olisi tahrannut hänen joukkonsa urhouden mainetta. Hän
räjähdytti senvuoksi tornin ilmaan, syösten vihollisen joukosta
enemmän kuin 400 kanssansa kuolemaan.
9. Marssi Juutinmaalle.
Omin voimin tuli siis sekä Liivin- että Suomenmaan nyt pitää
puoliansa, ja tämä vaikea tehtävä tulikin verrattomalla
alttiiksiantaumuksella, urhoudella sekä menestyksellä suoritetuksi.
Riian vähälukuinen linnaväki (porvarien kanssa ainoastaan 5,000
miestä, joissa 16 komppaniaa suomalaisia) teki miehuullista
vastarintaa. Turhaan maleksivat venäläiset seitsemän viikkoa
kaupungin ympärillä, ahdistaen sitä piiritystöillään niin paljon kuin
heidän puuttuva taitonsa näissä asioissa myöten antoi.
Loppupäätöksenä oli kuitenkin se, että heidän, menetettyänsä
14,000 miestä, täytyi tyhjin käsin poistua.
Leijonhufvud aikoi nyt, kun oma maa oli puhdistettu, siirtää sodan
rajan yli vihollisen alueelle. Tätä hanketta ei ollut hänen kuitenkaan
sallittu johtaa, sillä hän kuoli Raudulla kuumetautiin. Ylimmän
komennon otti käteensä nyt kenraalimajuuri Kruse. Hän vei melkein
koko sotavoimansa uuden vuoden (1657) alkupäivinä Aunukseen.
Heidän täytyi tosin tyhjin toimin kääntyä pois Aunuksenkaupungin
edustalta, jonka venäläiset olivat varustaneet liian vahvaksi. Mutta
koko maaseutu hävitettiin laajalta. Kaikki tavatut ihmiset tapettiin
ilman eroitusta, ja karjakin, jota rehun puutteen tähden ei voitu
poiskuljettaa, poltettiin. Tulen omaksi joutui niinikään 11 kirkkoa,
lukemattomia kyliä, sekä suuri joukko pitkin Laatokan rantaa
kiinnijäätyneitä aluksia. "Kaiken tämän johdosta", kehui Kruse, "ovat
nuo raakalaiset joutuneet suuren pelon valtaan." Mutta
raakalaisnimenpä meidän omatkin soturimme täydesti ansaitsivat,
sillä he olivat sodankäynnissään melkein samallaisia petoja kuin
heidän itäiset naapurinsa. Siinä suhteessa he vain olivat noita
paremmat, etteivät he toki tappaessaan näytä harjoittaneen
luonnotonta, kiduttavaa julmuutta.
ebookbell.com