#REDIRECT [[IBM Db2#Technical information]]
{{Advert|article|date=August 2010}}
{{Citation style|date=October 2011|details=Violates Wikipedia:External links: "Wikipedia articles may include links to web pages outside Wikipedia (external links), but they should not normally be used in the body of an article."}}
{{Redirect category shell|1=
{{Infobox software
{{R to section}}
| name = pureQuery
{{R from merge}}
| developer = [[IBM]]
| latest release version = 2.2
| latest release date = {{release date|2009|06|18}}
| operating_system = [[Cross-platform]]
| platform = [[Java platform|Java]]
| genre = Java Data Access [[platform (computing)]]
| website = [http://www.ibm.com/software/data/studio/purequery/ IBM Data Studio]
[http://www.ibm.com/developerworks/downloads/im/datastudiodev/?S_TACT=105AGX01&S_CMP=LP pureQuery download]
}}
'''pureQuery''' is [[IBM]]'s, high-performance data access [[platform (computing)|platform]] focused on simplifying, developing, securing, managing, and optimizing new and existing applications that access data. Data access includes the [[persistence (computer science)|persistence]] of the data encapsulated in [[Object (computer science)|objects]] and all data [[Create, read, update and delete|CRUD]] operations. pureQuery supports both [[Java platform|Java]] and [[.NET Framework|.NET]].
The benefits of using pureQuery extend throughout the [[Database design|design]], [[software development|development]], [[software deployment|deployment]], [[management]], and [[Information technology governance|governance]] stages of the application [[software life cycle|life cycle]].
pureQuery provides access to data in [[database]]s and in-memory Java [[Object (computer science)|objects]] via its [[programming tool|tool]]s, [[API]]s, and [[Run-time system|runtime]] environment as delivered in [http://www.ibm.com/software/data/studio/developer/ IBM Data Studio Developer] and [http://www-306.ibm.com/software/data/studio/purequery/ IBM Data Studio pureQuery Runtime].
==Feature summary==
pureQuery makes Java data access simple for [[Agile software development|agile]] development and improved application performance. pureQuery can be used both in [[standalone software|standalone]] [[Java Platform, Standard Edition|Java SE]] applications and in [[Java EE]] applications using [[Java Servlet|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 [http://www.projectzero.org/wiki/bin/view/Documentation/CoreDevelopersGuideDataAccess data access].
Optim Development Studio provides the development tools for pureQuery. It includes an integrated [[Eclipse (software)|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 [http://java.sun.com/javaee/technologies/index.jsp 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 [http://java.sun.com/products/jdbc/download.html#corespec40 JDBC 4.0] specification, although it is not in the final JDBC 4.0 spec.
==pureQuery Java API code sample==
Inline Style Example:
<source lang="java">
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);
</source>
Annotated Method Style Example:
<source lang="java">
// 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);
</source>
==pureQuery client optimization ==
#Capture the SQL
**Use pureQuery API, generate from WebSphere JPA, or capture while executing
**Use with custom-developed, framework-based, or packaged applications
#Bind SQL to DB2
**Use tooling in Data Studio Developer, WAS console, or command line
#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'''<br />
[http://www.dbmag.intelligententerprise.com/showArticle.jhtml?articleID=202400140 The Easy Way to Quick Data Access] <br/>
[http://www.devx.com/DevX/Article/40240 Smoothly Blending Java and SQL with pureQuery] <br/>
[http://www.ibm.com/developerworks/db2/library/techarticle/dm-0709surange/ Overview of pureQuery tools, Part 1: Increase productivity in Java database development with new IBM pureQuery tools]<br />
[http://www.ibm.com/developerworks/db2/library/techarticle/dm-0709surange2/ Increase productivity in Java database development with new IBM pureQuery tools, Part 2: Detect and fix SQL problems inside Java program] <br/>
[http://www.ibm.com/developerworks/edu/dm-dw-dm-0711surange-i.html?S_TACT=105AGX02&S_CMP=EDU Increase productivity in Java database development with new IBM pureQuery tools, Part 3: pureQuery rapid application development] <br/>
[http://www.ibm.com/developerworks/web/library/wa-pz-wiki/?open&ca=dna-flht-01172008&S_TACT=106AH62W&S_CMP=NEWS Use Project Zero's data access APIs to build a simple wiki] <br/>
[http://www.ibm.com/developerworks/db2/library/techarticle/dm-0804lamb/ Write high performance Java data access applications, Part 1: Introducing pureQuery annotated-method style]<br />
[http://www.ibm.com/developerworks/db2/library/techarticle/dm-0804vivek/ Write high performance Java data access applications, Part 2: Introducing pureQuery inline style ]<br />
[http://www.ibm.com/developerworks/db2/library/techarticle/dm-0808rodrigues/ Write high performance Java data access applications, Part 3: pureQuery best practices ]<br />
[http://www.ibm.com/developerworks/data/tutorials/dm-0903optimizenet/ Optimize your existing .NET applications using IBM Data Studio's pureQuery]<br />
[http://www.ibm.com/developerworks/data/library/techarticle/dm-0906optimdeveloper/index.html What's new and cool in Optim Development Studio 2.2]
'''Download pureQuery''' <br />
http://www.ibm.com/developerworks/downloads/im/datastudiodev/?S_TACT=105AGX01&S_CMP=LP <br />
'''pureQuery Forum (aka newsgroup)''' <br />
http://www.ibm.com/developerworks/forums/dw_forum.jsp?forum=1086&cat=19 <br />
http://www.iiug.org/forums/datastudio/ <br/>
'''pureQuery Documentation''' <br />
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.overview.doc/topics/helpindex_pq_sdf.html <br/>
'''Using the pureQuery API documentation''' <br />
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/cpdqrunusepqapi.html <br/>
'''pureQuery Javadocs'''<br/>
http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/javadoc/overview-summary.html<br/>
System Requirements <br/>
http://www-01.ibm.com/support/docview.wss?rs=4015&uid=swg27015712 <br/>
FAQ <br/>
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 ==
* IBM [[Project Zero]]
* [[Java Persistence API]]
* [[Apache OpenJPA]]
* [[Hibernate (Java)]]
* [[Spring Framework (Java)]]
* [[MyBatis]]
* [[iBATIS]]
* [[Service Data Object]]
* [[Language Integrated Query]]
* [[IBM WebSphere eXtreme Scale]]
{{IBM DB2 product family}}
{{IBM}}
{{Java Persistence API}}
{{DEFAULTSORT:Purequery, Ibm}}
[[Category:IBM Information Management software|PureQuery]]
[[Category:Java platform]]
[[Category:Java enterprise platform]]
[[Category:Software architecture]]
[[Category:Web applications| ]]
[[Category:Web development]]
[[Category:Eclipse (software)]]
[[Category:Eclipse technology]]
[[Category:Eclipse software]]
[[Category:Object-relational mapping]]
[[Category:Persistence]]
|