Subject: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?
Subject: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?
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.
Subject: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?
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.