IBM PureQuery

From Wikipedia, the free encyclopedia

pureQuery
IBM logo
Developed by IBM
Latest release 1.1.2 / March 28, 2008
OS Cross-platform
Platform Java
Genre Java Data Access platform (computing)
Website IBM Data Studio
 pureQuery download

pureQuery is IBM's new, high-performance Java data access platform focused on simplifying the tasks of developing and managing applications that access data. Java data access includes Java persistence and all data CRUD operations.

The benefits of using pureQuery extend throughout the 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.

Contents

[edit] 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.

pureQuery includes an integrated Eclipse Java and query(SQL, SQL/XML, XQuery) editor that provides Java data access developers with an interactive software development environment.

pureQuery supports two programming styles: inline and method style.

[edit] pureQuery 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, :commision)", 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);

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, :commision)")
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);

[edit] Resources

Articles
The Easy Way to Quick Data Access
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
Download pureQuery
https://www14.software.ibm.com/webapp/iwm/web/preLogin.do?lang=en_US&source=swg-ids
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/dstudio/v1r1m0/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/cpdqruntop.html
pureQuery Javadocs
http://publib.boulder.ibm.com/infocenter/dstudio/v1r1m0/index.jsp?topic=/com.ibm.datatools.javatool.runtime.doc/topics/javadoc/overview-summary.html

[edit] History

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

The first pureQuery openBeta ended 10-31-07. IBM Data Studio v1.1, which contains pureQuery, was released on 10-31-07. IBM Data Studio 1.1.1, IBM Data Studio Developer and IBM Data Studio pureQuery runtime were released 12-12-07. IBM Data Studio 1.1.2 or fixpack 2 was released 3-28-08.

[edit] See also