IBM PureQuery

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search
pureQuery
IBM logo
Developer(s) IBM
Stable release 2.2 / June 18th, 2009
Operating system Cross-platform
Platform Java
Type Java Data Access platform (computing)
Website IBM Data Studio pureQuery download

pureQuery is IBM's, high-performance data access platform focused on simplifying, developing, securing, managing, and optimizing new and existing applications that access data. Data access includes the persistence of the data encapsulated in objects and all data CRUD operations. pureQuery supports both Java and .NET.

The benefits of using pureQuery extend throughout the design, development, deployment, management, and governance stages of the application life cycle.

pureQuery provides access to data in databases and in-memory Java objects via its tools, APIs, and runtime environment as delivered in IBM Data Studio Developer and IBM Data Studio pureQuery Runtime.

Feature summary

pureQuery makes Java data access simple for agile development and improved application performance. pureQuery can be used both in standalone Java SE applications and in Java EE applications using servlets or EJB session beans. pureQuery can also be used to develop your data access for Web 2.0 applications. For example, pureQuery can return XML and JSON from a data source. IBM's Project Zero uses pureQuery for its data access.

Optim Development Studio provides the development tools for pureQuery. It includes an integrated Eclipse Java and query(SQL, SQL/XML, XQuery) editor that provides Java data access developers with an interactive software development environment. This provides query content assist within the Java editor in Eclipse.

pureQuery supports two programming styles: inline and method style.

In an annotated method pureQuery application, the SQL string is defined as an element of a Java 5.0, pureQuery Annotation, such as @Select, @Update and @Call. pureQuery tooling automatically generates an optimized implementation for the annotated method. The annotated method style is capable of supporting both static and dynamic execution of SQL.

In the inline style, SQL statements can be created “inline” within the code as a java String object. This dynamically generated statement is passed as a String parameter to the pureQuery Data interface method. The inline style was based on an early draft enhancement to the JDBC 4.0 specification, although it is not in the final JDBC 4.0 spec.

pureQuery Java API Code Sample

Inline Style Example:

Data data = DataFactory.getData (datasource);
// Insert an employee of type Employee bean in the database
data.update("insert into EMPLOYEE (EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY,
 BONUS, COMM) values( :employeeNumber, :firstName, :midinit, :lastname, :workdept, :phoneno, :hiredate, :job, :edlevel, :sex, 
:birthdate, :salary, :bonus, :commission)", employee);

// Query the database for employees
Iterator<Employee> employees = data.queryIterator ("select * from EMPLOYEE", Employee.class);

// Query the database for one employee
Iterator<Employee> employee = data.queryFirst ("select * from EMPLOYEE where EMPNO = :employeeNumber", Employee.class, 
  employees);

Annotated Method Style Example:

// Annotate createEmployee method with sql to execute when method is invoked
@Update(sql="insert into EMPLOYEE (EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, SALARY,
  BONUS, COMM) values( :employeeNumber, :firstName, :midinit, :lastname, :workdept, :phoneno, :hiredate, :job, :edlevel, 
:sex, :birthdate, :salary, :bonus, :commission)")
int createEmployee(Employee e);

// Annotate getEmployees method with sql to execute when method is invoked
@Select(sql="select EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, 
  SALARY, BONUS, COMM from EMPLOYEE")
Employee getEmployees(); 	

// Annotate getEmployee method with sql to execute when method is invoked
@Select(sql="select EMPNO, FIRSTNME, MIDINIT, LASTNAME, WORKDEPT, PHONENO, HIREDATE, JOB, EDLEVEL, SEX, BIRTHDATE, 
  SALARY, BONUS, COMM from EMPLOYEE where EMPNO = :employeeNumber")
Employee getEmployee(Employee e);

pureQuery client optimization

  1. Capture the SQL
    • Use pureQuery API, generate from WebSphere JPA, or capture while executing
    • Use with custom-developed, framework-based, or packaged applications
  1. Bind SQL to DB2
    • Use tooling in Data Studio Developer, WAS console, or command line
  1. Choose execution mode
    • Dynamic or static
    • Choose at deployment time instead of development time

.NET Support

.NET support was added in the pureQuery 2.1 release. It currently has support of the pureQuery Client optimization feature which allows dynamic SQL execution .NET programs to be converted to static SQL execution.

Resources

Articles
The Easy Way to Quick Data Access
Smoothly Blending Java and SQL with pureQuery
Overview of pureQuery tools, Part 1: Increase productivity in Java database development with new IBM pureQuery tools
Increase productivity in Java database development with new IBM pureQuery tools, Part 2: Detect and fix SQL problems inside Java program
Increase productivity in Java database development with new IBM pureQuery tools, Part 3: pureQuery rapid application development
Use Project Zero's data access APIs to build a simple wiki
Write high performance Java data access applications, Part 1: Introducing pureQuery annotated-method style
Write high performance Java data access applications, Part 2: Introducing pureQuery inline style
Write high performance Java data access applications, Part 3: pureQuery best practices
Optimize your existing .NET applications using IBM Data Studio's pureQuery
What's new and cool in Optim Development Studio 2.2

Download pureQuery
http://www.ibm.com/developerworks/downloads/im/datastudiodev/?S_TACT=105AGX01&S_CMP=LP
pureQuery Forum (aka newsgroup)
http://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=1086&cat=19
http://www.iiug.org/forums/datastudio/
pureQuery Documentation
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.overview.doc/topics/helpindex_pq_sdf.html
Using the pureQuery API documentation
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/cpdqrunusepqapi.html
pureQuery Javadocs
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/javadoc/overview-summary.html
System Requirements
http://www-01.ibm.com/support/docview.wss?rs=4015&uid=swg27015712
FAQ
http://www-01.ibm.com/software/data/optim/purequery-platform/faq.html

History

pureQuery was developed by a team of Java software developers from IBM Information Management Software group.

The first pureQuery openBeta ended October 31, 2007. IBM Data Studio v1.1, which contains pureQuery, was released on 10-31-07. IBM Data Studio 1.1.1, including IBM Data Studio Developer and IBM Data Studio pureQuery Runtime were released December 12, 2007. IBM Data Studio 1.1.2 (or fixpack 2) was released March 28, 2008. IBM Data Studio Developer and IBM Data Studio pureQuery Runtime v1.2 were released on July 31, 2008. IBM Data Studio pureQuery Runtime for z/OS was released on August 29, 2008.

IBM Data Studio Developer 2.1 and IBM Data Studio pureQuery Runtime 2.1 (for Linux, UNIX, and Windows) were released on December 19, 2008.

IBM Optim Development Studio 2.2 and IBM Optim pureQuery Runtime 2.2 (for Linux, UNIX and Windows) were released on June 18, 2009. pureQuery was renamed from Data Studio pureQuery to Optim pureQuery at the 2.2 release. IBM Data Studio Developer was also renamed to IBM Optim Development Studio at the 2.2 release.

See also

Template:IBM DB2 product family Template:IBM Template:Java Persistence API