XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
Midas WangSubject: Want to execute a XQuery by API
Author: Midas Wang
Date: 13 Dec 2006 10:10 PM
I am using datadirect processor.
I want to execute a XQuery file by API like XQueryRunner.query(XQueryFilePath). But when there is RDB collections in the xquery, the datadirect API need a database configuration stream to initilize the connection.
Is there any method to generate such a configuration stream by program?

Thanks,
Midas

Postnext
Minollo I.Subject: Want to execute a XQuery by API
Author: Minollo I.
Date: 13 Dec 2006 10:22 PM
Take a look at the documentation:
http://media.datadirect.com/download/docs/ddxquery/ddxqug/conf_sourcefiles.html#wp182031

A simple example is:
...
DDXQDataSource ds = new DDXQDataSource();
ds.setProperty(com.ddtek.xquery.xqj.mediator.DDXQDataSource.JDBCURL, "jdbc:xquery:sqlserver://localhost:1433;databaseName=PortfolioData;user=sa;password=");
XQConnection connection = ds.getConnection();
XQExpression expression = connection.createExpression();
File xqueryFile = new File("c:/my.xquery");
XQSequence sequence = expression.executeQuery(new InputStreamReader(new FileInputStream(xqueryFile)));
...

Postnext
Midas WangSubject: Want to execute a XQuery by API
Author: Midas Wang
Date: 13 Dec 2006 10:35 PM
Thank you, Ivan. You give me a method to do the DB connection.
Actually, I found such connection information in the XQuery metaInformation section. And when I generated Java code from this XQuery, I got a file like 'c_Scenario1.xml' which included some db connection information in another format.
I want to know is there any API provided to extract such a xml from the XQuery file?

Thanks,
Midas

Postnext
Minollo I.Subject: Want to execute a XQuery by API
Author: Minollo I.
Date: 13 Dec 2006 10:41 PM
There isn't an automated way to extract the connection information that Stylus Studio stores in the XQuery file as a comment. The general idea is that the information stored in the XQuery file is used at development time; and that at deployment time you use different ways to get the proper information, which is potentially different.

In theory you could parse that information yourself, but I would strongly discourage that approach.

Postnext
Midas WangSubject: Want to execute a XQuery by API
Author: Midas Wang
Date: 13 Dec 2006 10:49 PM
Why do you discourage this way?
I want to use this way to store RDB connection information, also allow user to reset it in deployment.
Is there any problem with this method?

Thanks,
Midas

Postnext
Minollo I.Subject: Want to execute a XQuery by API
Author: Minollo I.
Date: 13 Dec 2006 10:56 PM
The problem is that the "meta-information" stored by Stylus Studio is an internal format that is not guaranteed to remain unchanged or backward compatible in future versions of the tool.

Posttop
Midas WangSubject: Want to execute a XQuery by API
Author: Midas Wang
Date: 14 Dec 2006 12:12 AM
I see. Thank you!

Midas

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.