background preloader

J2EE

Facebook Twitter

Understanding pureQuery, Part 1: pureQuery: IBM's new paradigm for writing Java database applications. Introduction The objectization of relational data access Most businesses are built on information management systems whose main underlying infrastructures are based on data stored in one or more relational databases. These systems consist of software programs whose sole purpose is information processing and are implemented in managed languages such as Java. As an OO-based language characterized by ease of use for encapsulation, inheritance and polymorphism, Java is used on the one hand to implement the computational and logical aspects of information processing programs, and on the other hand to access and manipulate relational data.

Java defines information in terms of objects, while relational databases use rows. Objects are unique instances of the class to which they belong, and hence they are physically distinct from one another. Similarly, relational database rows are also unique, so long as they are identified by primary key values. Back to top pureQuery: What is it? A quick tour. Write high performance Java data access applications, Part 2: Introducing pureQuery built-in inline methods.

Overview pureQuery simplifies Java data access development by providing out-of-the-box support for storing and retrieving objects, such as Java beans and maps, to and from the database. Inline methods also support the use of customized user-defined result processing. With annotated methods, the SQL/XQUERY string is defined within a pureQuery annotation. These annotations are placed on method declarations within a user-defined interface. A code generator pre-processes the interface to generate implementation code for each annotated method. The generated implementation code executes the SQL statements defined in the annotation using the pureQuery runtime. The pureQuery built-in inline methods were introduced to reduce the repeated tasks that are common to querying or updating a database using JDBC by introducing a set of well-defined and efficient APIs that are simpler and easier to use than JDBC. Table 1. This article includes: Back to top Developing inline methods The data interface.

Write high performance, Java data access applications, Part 1: Introducing pureQuery annotated method data access objects. Overview The pureQuery data access platform provides benefits to data access applications by enabling improved performance, improved developer productivity, improved management, and improved problem determination. The Resources section of this article includes references to help you understand the benefits of pureQuery. These benefits do not require the use of the pureQuery API, made possible by using a process called client optimization. However, the focus of this article series is on new development and the use of the pureQuery APIs, which you can use with the DB2 family, Informix, and Oracle databases. This article covers the following topics related to pureQuery data access objects (DAOs), created using annotated methods: If you are ready to start coding, skip to the technical breakdown. A brief example follows to show why developers might choose to use pureQuery data access objects.

Back to top What are annotated method data access objects? A motivating example The paradigm: Listing 3. X-ameeintro-pdf.pdf (Objet application/pdf) Write high performance Java data access applications, Part 3: pureQuery API best practices. Introduction The first two articles of this series described in detail how to use inline methods and how to use data access object interfaces (DAOs) to access the database. This third article provides you with insight on various best practices of development using pureQuery. Most of these practices exploit the advanced features of the pureQuery API.

Whenever applicable, a real world scenario is used to illustrate the usage of the described feature. The code snippets included are for illustrative purposes only, but should give you a good idea of how to use the API. Choose inline or DAOs In the previous articles of this series, the authors presented use cases for both DAOs and use of inline methods. Both approaches have their advantages, so here are some things to consider when trying to decide which to use: Use DAOs if you: Use pureQuery inline methods if you: Like to have your SQL statements inline in your Java code, just like regular JDBC programmingHave dynamically generated queries //...

Jazoon : Groovy seven usage patterns. Première conférence : Groovy, Seven Usage Patterns par Dierk König. L’objectif de cette présentation est de nous montrer 7 cas d’utilisations réels de Groovy dans le monde de l’entreprise. Voici une photo prise durant la séance : #1 SuperGlue Groovy permet de créer rapidement des applications simples en utilisant l’API de base. Dierk nous montre cela en écrivant en quelques lignes un lecteur de flux RSS qui affiche dans une fenêtre de type Swing la liste des derniers billets. Groovy est un moyen rapide de créer de l’assemblage. . #2 Liquid Heart Ce pattern d’usage vise à nous montrer comment réutiliser la couche métier d’une application existante pour réutiliser les services avec du Groovy. . #3 Keyhole Surgery Ce pattern discutable vise à ouvrir une porte cachée dans l’application afin d’exécuter du Groovy. . #4 Smart Configuration Groovy est bien plus intelligent que des fichiers de configuration XML.

. #5 Unlimited Openness Plus qu’un pattern, Dierk parle maintenant de l’accès au code. X-ameetut-pdf.pdf (Objet application/pdf) Le Touilleur Express.