xquery freeing xml and relational data for the web
Post on 13-Sep-2014
714 Views
Preview:
DESCRIPTION
TRANSCRIPT
1
XQueryFreeing XML and Relational Data for the Web
2
Overview• XQuery• The XQuery API for Java (XQJ)• DataDirect XQuery• Usage Scenarios
• XML Publishing• Web Publishing• Web Services
• Gevity Customer Story
Download DataDirect XQuery: http://www.datadirect.com/downloads/registration/xquery/
3
XML from Relational, XML
HOLDINGS
USERID TICKER SHARES
Jonathan PRGS 23
Minollo PRGS 4000000
Jonathan AMZN 3000
Minollo AMZN 3000
HISTORICAL
TICKER DATE ADJUSTEDCLOSE ACTUALCLOSE
AMZN 24-Jun-04 44.69 44.69
EBAY 24-Jun-04 85.33 85.33
PRGS 24-Jun-04 18.78 18.78
YHOO 1-Jul-04 32.48 32.48
<request> <performance> <userId>Jonathan</userId> <start>2003-01-01</start> <end>2004-06-01</end> </performance></request>
<portfolio userId="Jonathan"> <stock ticker="AMZN"> <performance> <min>18.86</min> <max>59.69</max> <daily> <day> <datetraded>2003-01-02</datetraded> <adjustedclose>22.61</adjustedclose> </day> <day> <datetraded>2003-01-09</datetraded> <adjustedclose>22.18</adjustedclose> </day> <day> <datetraded>2003-01-16</datetraded> <adjustedclose>21.93</adjustedclose> </day> <day> <datetraded>2003-01-23</datetraded> <adjustedclose>18.86</adjustedclose> </day> <day> <datetraded>2003-01-30</datetraded>
4
What is XQuery?• Query Language for XML
• Find anything in an XML structure (path expressions)• Create any XML structure (constructors)• Combine data to create new structures (FLWOR expressions)
• Designed for Industrial Strength Applications• Declarative language - optimizable• Type safety
• Designed for Data Integration• Non-XML sources viewed as XML (e.g. Relational)
• Status• Candidate Recommendation• Support from most major relational vendors• 45+ implementations on W3C page• Recommendation: 1H 2006? 3Q 2006?
8
Portfolio Demo: The Queries
9
Portfolio Demo: XQuery Summary• FLWOR expressions
• Like SQL’s SELECT-FROM-WHERE• Allow data to be combined based on conditions
• Path expressions• Can locate anything in a document
• Constructors• Allow any result to be created• “XML Report Writing”• Web messages• Data for web sites
• XML Views of Relational Data• Unified view of relational, XML sources• Data integration• Web message processing
10
What is XQJ?• XQuery API for Java (XQJ) – JSR 225• Analogous to JDBC• Status: first Early Draft Review
• Early Draft Review 2 expected very soon• Final expected shortly after XQuery 1.0 Recommendation
11
XQuery and XQJ
Application XQJ
XQuery
XML Result XML Input
XML View of RDB
Dat
a So
urce
s
12
XQJ: A Prepared Query// Get a connection, prepare the query
dataSource = new DDXQDataSource(); dataSource.setJdbcUrl(“jdbc:xquery:sqlserver://server1:1433;databaseName=stocks”); connection = dataSource.getConnection(); preparedExpression = connection.prepareExpression(xqueryText);
// Bind variable $l to 'Jonathan' and execute
preparedExpression.bindString(new QName("p"), "Jonathan"); xqSequence = preparedExpression.executeQuery(); System.out.println("\n\nHoldings for Jonathan:\n\n"); System.out.println(xqSequence.getSequenceAsString());
// Bind variable $l to 'Minollo' and execute
preparedExpression.bindString(new QName("p"), "Minollo"); xqSequence = preparedExpression.executeQuery(); System.out.println("\n\nHoldings for Minollo:\n\n"); System.out.println(xqSequence.getSequenceAsString());
13
DataDirect XQuery• Standards-based XQuery
implementation• Simplifies XML and Relational data
integration• Industry-leading query optimization
and mediation technology• Easily embeddable – plugs into any
architecture, does not require a server
• Works with most databases and application servers
14
DataDirect XQuery• XQuery for the Java platform
• Pure Java implementation• Any Java platform• Any server – or no server• Easily embeddable – installs
like JDBC driver• XQuery API for Java (XQJ)
• Database support• SQL Server 2000• Oracle 9i, 10gR1• DB2 W/U/L: 8.x • DB2 iSeries: v5r2, v5r3 • DB2: z/OS: 8 • Sybase: 12.5
• XML sources• http: ftp: and file: schemes • XML in DOM trees
• XML Output• XML as text• XML in DOM trees • XML in SAX streams • XML in StAX streams
• Designed for performance!• Java developer IDE:
• <oXygen/> XML Editor for Eclipse (DataDirect Edition)
• Inexpensive for DataDirect XQuery 1.0 licensees
• XML IDE• Stylus Studio XML
Enterprise Edition • Purchased separately
15
Scenario: XML Publishing
XML
XML
HTML,PDF,PostScript,Paper…SQL
16
Scenario: Web Publishing
App Server
HTTP
HTML
HTTP Request
Web Server
Application
XML
SQL
17
Scenario: Web Services
App Server
HTTP
SOAP Request
SOAP Server
Application
XML XML
SQL
18
Customer Story: Gevity
How much will it cost to outsource our HR to Gevity?
XQuery queries w/data from SalesForce.com
XML
Oracle 9i
Human Resource Data
PDF w/ pricing for prospect
• Users: Gevity sales representatives• Purpose: quickly produce price quotes from
within SalesForce.com• Data: Human Resource Data in Oracle 9i,
customer and prospect data in SalesForce.com• Can manage accounts from any internet
connection – home, office, prospect’s office, or any Wi-Fi hot spot
• Deliver through many agents – browser, cell phone, blackberry, etc
19
Customer Story: GevityWhy XML?
• Easiest way to do data integration
Why XQuery? • XQuery + XQJ integrates easily into their environment• XQuery is best for manipulating data as XML• XQuery simplifies merging relational and XML • Increasingly difficult for developers to keep up with peculiarities in
proprietary XML tools – XQuery and XQJ are standards
Why DataDirect XQuery? • Easily embeddable – can live in middle tier with the application• Follows standards closer than other implementations• XQJ is like JDBC, and integrates easily into their architecture• <oXygen/> XML Editor for Eclipse – an IDE that helps with learning curve of
new language• First class support for help with queries and tuning• DataDirect’s length of time in market and financial stability
20
Download DataDirect XQuery: http://www.datadirect.com/downloads/registration/xquery/
? ??
top related