XSQL Question:

I would like to know if I can use XSQL queries to retrieve XML ResultSet through a Java Swing program.
Thanks

Not exactly, but what you want instead
of the command-line is the programmatic
API for the XSQL Page Engine.
This is in the class:
oracle.xml.xsql.XSQLRequest
See the Javadoc for how to use it.
It has only one method... process()
and does the rest for you.

Similar Messages

  • XSQL Questions

    Q1) Where can I get some more info on XSQL? Steve's release notes were great, but if anyone knows of a tutorial or some getting started info, I'd really appreciate it!
    Q2) Which browsers will work with XSQL?
    Q3) I still can't run my demo... it is called bean1.xsql and the code is:
    <?xml version="1.0"?>
    <xsql:query connection="demo" xmlns:xsql="urn:oracle-xsql" >
    SELECT table_name FROM all_tables
    </xsql:query>
    when I run it in my browser (IE5.5) it displays the generated code, not the table. The same thing happens when I run Steve's Hello World demo. Any suggestions?
    Thanks, Janice

    Yeah,
    I'm having simular problems with geting an XSL syle sheet to work on IE5.5 for the demos. I hope someone has some has some hints for us.
    Upgrading IE 5.5 with the latest xml processor from MS made things worse.
    Ben
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Lewis Cunningham ([email protected]):
    A1) Steve's book is good and the xml handbook has some limited info on xsql.
    A2) If you do your xsl translation on the middle tier and you pretty much follow the html standards than any browser can be used. If you do client xsl translation, or use elements only supported by IE, then you have to use IE.
    A3) When I double click on on an xsql file, it just displays the code. If I run it from the web server, in may case http://localhost:7070, the it works. I don't know if this is your case or not.
    Lewis<HR></BLOCKQUOTE>
    null

  • A XSQL Question

    Hi,
    Can someone kind soul please enlighten me?
    I would like to know whether can XSQL do an update on a record in the database. So far, it seems to me that only retrieving and writing is allowed.
    Thanks in advance,
    Jerry

    You should be able to call a procedure using <xsql:dml> or <xsql:include-owa> that does the trick.
    -->cristian

  • XSQL DTD, XSQL command line, XSL parameters

    I have three quick XSQL questions:
    1. Is there a DTD available for XSQL? I'd like to feed it to Emacs' PSGML mode (http://www.lysator.liu.se/projects/about_psgml.html). What do you other Emacsers use to edit XSQL and XSL files?
    2. XSQL is working fine under Apache/jserv, but the command line isn't finding my DB connections as defined in XSQLConfig.xml:
    XSQL-004: Could not acquire a database connection named: lcbean@isis
    Does this mean XSQL couldn't find the connection description, or couldn't connect to it after finding it? It does use CLASSPATH to locate XSQLConfig.xml, right?
    3. I'm trying to use parameters in an XSL stylesheet as follows:
    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:param name="store_code" select="'999'"/>
    <head><title>Test</title></head>
    <body><p><xsl:value-of select="$store_code"/></p></body>
    </html>
    But I keep getting:
    XSL-1031: Variable not defined: 'store_code'
    What am I missing?
    null

    [list=1]
    [*]No. Since XSQL action elements are allowed to appear anywhere in any well-formed XML document, you cannot really describe this in a DTD.
    [*]This means you put a connection="lcbean@isis" attribute on the document element of your XSQL page, but that it could not find a <connectiondef> for that name in XSQLConfig.xml (which is found successfully if it got this far!).
    [*] See Section 11.5 in the XSLT 1.0 specification. <xsl:param> must appear immediately at the top of a template before any literal result elements. This means that <xsl:param> cannot be used in a "simple-form" stylesheet. You can either use <xsl:variable> instead, or you'll have to change to the full-form of the <xsl:stylesheet> and place the <xsl:param> at the top-level of the stylesheet, outside of any <xsl:template>.
    [list]

  • XSQL SVG Example questions

    The SVG example provided with the XSQL servlet is excellent and illustrates at least 5 different (and very useful) techniques. Congrats to whoever came up with it.
    This one example shows SVG, named templates, use of xsl:variable, use of xsl_param, use of xsl:with-param, use of xsl:call-template and the apparent use of java classes from a jar file ala java server pages.
    The example also raises several questions:
    1. The example uses two namespace declarations I haven't seen before -
    xmlns:Color="http://www.oracle.com/XSL/Transform/java/java.awt.Color"
    and
    xmlns:Integer="http://www.oracle.com/XSL/Transform/java/java.lang.Integer"
    These appear to be allowing the use of Java classes in some jar file similar to the way Java server pages might do it.
    It this correct? Is this because these two classes were built-in to the XSQL servlet? What other classes can be used? All of them? From any jar file? Is more documentation available?
    2. What does the 'doctype=system="svg-19990812.dtd"' line do? There is no such DTD on my system but the demo works fine. There are references to DTDs with similar names in the FOP samples and in Adobe's samples but the name is slightly different.
    3. Why is the media-type image/svg? The SVG 1.0 spec dated 2 Nov 2000 in section 1.2 says the SVG mime type is "image/svg+xml".
    4. Why is there no namespace declaration for the svg tag or any of the svg related tags? Samples from other vendors seem to always have a declaration.
    Thanks again for a great piece of code.
    null

    Rick,
    You'll find a further-refined, and fully-explained version of the SVG example in Chapter 16 of Building Oracle XML Applications. This chapter covers the use of XSLT extension functions and illustrates how to use Java extension functions with the Oracle XSLT engine.
    [list=1]
    [*]The two namespaces you list are the way that the Oracle XSLT engine allows you to map extension functions in a namespace to methods of a Java class. This example illustrates using two different built-in classes of the JDK, java.awt.Color and java.lang.Integer. These are not specific to (or built-in in any way to the) XSQL processor or the XSLT engine, but are base classes in the JDK. You can use any Java extension functions in your XSLT stylesheets. The only requirement is that you (1) get the namespace correct to assign a namespace to the appropriate fully-qualified classname, and (2) make sure the classes you want to use are in the CLASSPATH.
    [*]The <xsl:output> attribute doctype-system provides a value to be used for the SYSTEM URI of the <!DOCTYPE in the transformed output. The particular value was required by the SVG draft at the time I built the demo. It must be handled by a special entity-resolver built into the SVG Viewer that you're using, which explains why not having on your system as a physical file doesn't stop the demo from working.
    [*]The media-type is image/svg instead of image/svg+xml because the SVG demo was built before the final draft of SVG went out. This value was apparently changed in one of the final drafts. It appears that the Adobe SVG viewer registers itself as the handler for both.
    [*]See http://www.w3.org/TR/SVG/struct.html#NewDocument. The spec appears to allow both unqualified use of <svg> as well as namespace-qualified <svg:svg> when SVG is embedded within another document.
    [list]

  • XSQL/XSL deployment on Tomcat question

    I have been running my XSQL pages within the default Oracle/Apache/JServ environment. This is where I 'install' my source xsql/xsl files in the htdocs directory of Apache.
    I have now recently upgraded my environment so that it now consists of Tomcat 4.x and Apache.
    My question is, what deployment strategies are available to me? For example, do I have package my xsql/xsl files into a .war package or can I simply move my xsql/xsl source files into a certain directory very similar to how I use to do before.
    Any help greatly appreciated.

    I deployed both on Apache (JSP,XSQL) and I have another PC with Apache as Proxy.
    It works fine. I dont know the performance when many users try to connect.

  • Concept question on these technologies: Xquery, XSU & XSQL

    Hi, I wonder if anyone thought about this:
    I tried out a few samples on Xquery and that does meet my requirement --
    "Convert my relational data into an XML".
    Recently however, I learned there are also other technologies like XSU or XSQL(?).
    I tend to go a bit crazy when there exists more than one answer to the solution.
    Judging from some arcticles about XSU and XSQL, I could accomplish the same goal using one of these technologies.
    My questions are:
    1) I am not clear whether these 3 products are 'competing' products or complementing to each other.
    2) Which product would be better suited ( mostly ease of use from developer's point of view) to convert a relation data onto XML and may stay around longer into the future?
    I don't want to pick up a product that would go extinct in a few years.
    Any idea?
    Sun

    We have pretty much the same question.
    Of the three technologies... is XSQL a viable long-term option?
    Is there a more standards based solution like SQL/XML that is now considered the future?
    XSQL appeals to us because we can take our existing SQL queries and incorporate them into an xsql page and we manipulate results with XSLT if needed.
    What is the best way to leverage our existing SQL and output XML from our relational db tables?
    Thanks in advance for any info/clues.
    Jim

  • Question about xsql:set-page-param

    Hi!
    I have construction like this:
    <xsql:set-page-param name="ptk1" value="{@some_value}">
    where {@some_value} contains national characters. And in ptk1 I have only question marks. If I use {@some_value} directly, for example <xsql:query ...> <![CDATA select ... where field={@some_value} ]]> </xsql:query> it works fine. I have
    <?xml version="1.0" encoding="windows-1251" ?> in my xsql page.
    Is it possible to get set-page-param working with national chars?
    Thank you very much.

    You've identified a bug in how parameter values are retrieved. I've filed Bug#1920676 to get this fixed.
    Currently character set conversion is done between the servlet engine's default character set and the character set of the XSQL page template. The bug occurs because the character set conversion is being done in certain circumstances when it is not actually required.
    Will post a status update when we've identified a fix.

  • Xsql login question

    Is it possible to log in to a database without using the connectiondefs in the XSQLconfig.xml.
    If not, could username and password be passed as parameters to this XSQLconfig.xml?
    null

    Thanks , that works great.
    However if the procedure/function that I am calling has some pl/sql update and insert statements and i do
    <xsql:query>
    select update_status('XYZ') from dual
    </xsql:query>
    I do get an error that says "ORA-06051 FUNCTION update_status not allowed to update the database".
    In this scenario how do I output the XML for the return status code?
    Thanks in advance , and I hope my questions are not off base.
    null

  • Simple questions about XSQL Servlet

    I want to make available to a small LAN a small number of
    my schema's tables. I want them to be in XML format so that
    someone can see them with IE5.
    Is it possible to do this with XSQL Servlet?
    My server is MS Personal Webserver on NT Workstation and I use
    Oracle 8.0.5. Can I still use XSQL Servlet?
    George.
    null

    Hi Bertold, thanks for your answer!
    Hi Anton,
    1) The answer is yes. How do you know that the user
    is created without password in AD? Do you have any
    log files available?I solve my problem with synchronization of password - Time on domain controller and Sun ONE Directory Server was different (~10 hours). Now, i fix it, and all work perfectly.
    Thanks for your time, and be happy!

  • XSQL Paging Example Questions - XMLBOOK

    Hi all,
    I run example NewsCategorySimple.xsql?p=2&id=1 from XMLBOOK (S.Muench pag. 650), but it doesn't show stateless paging. shows data, but not: Page 1 of 4 Next - Total 19.
    I run over WNT4/Sp5, Ora816/R2, WEBDB/IAS, XSQL Utility (Examples is good), I don't have jdev 3.1 (is necesary?), my evironment variable CLASSPATH is add c:\xmlbook\samples\ch17\classes;....
    Examples http://localhost/orxmlapp/samples/ch17/store.html is good
    I think what configure Jserv (jserv.conf or jserv.properties) is the problem. can anybody help me
    Thanks..

    thanks, Steve
    now is ok, but i have an other problem, in the URL: http://ias/orxmlapp/Examples/ch17/
    I see the main page (index.html) and the message:
    "No stocks selected" and "You have not selected any news categories... Preferences for roy-ayala". (XMLBOOK pag. 684, Fig. 17-23)
    I added: wrapper.classpath=C:\xmlbook\samples\ch17\classes
    wrapper.classpath=C:\xmlbook\samples\ch06\classes
    in jserv.properties.
    and run all script in ch06 / ch17
    what do you think
    [email protected]
    null

  • Xsql:dml question

    This is what I am trying:
    <?xml version="1.0"?>
    <page connection="egemdev" xmlns:xsql="urn:oracle-xsql">
    <xsql:dml>
    begin
    ord_cancel_pkg.cancel_order('{@order}');
    exception
    when others then raise;
    end;
    </xsql:dml>
    <xsql:query >
    select order_status .....
    from orders
    where order_number = '{@order}'
    </xsql:query>
    </page>
    However, I don't want the query part to work if the dml part raises an exception. How do I do that?

    Best approach is either to use:
    <xsql:ref-cursor-function>
    and invoke a pl/sql stored function
    that calls your pkg.cancel(), then
    returns a REF CURSOR to the query if successful and a null REF CURSOR (or a REF CURSOR to a query like "SELECT 1 FROM DUAL WHERE 1 = 2" in case calling the proc throws an exception.

  • Unable to use the values returned by a PL/SQL stored procedure in a XSQL page

    Hi,
    I've been messing around with XML and XSQL in particular. I was trying to write a xsql page to display a report with account totals...I have the following .xsql which calls a PL/SQL stored procedure :
    <?xml version="1.0"?>
    <xsql:query connection="pfcdm" xmlns:xsql="urn:oracle-xsql">
    <xsql:set-session-param name="zasset_total" value="100">
    <xsql:dml connection="pfcdm">
    rraman.sp_vw_id(zasset_total,zinvm_total,zmkt_val);
    </xsql:dml>
    </xsql:set-session-param>
    select 'Asset total is {@zasset_total}' as "ASSET_TOTAL" from dual
    </xsql:query>
    My procedure sp_vw_id returns the values that it should. But, I am not sure how to declare variables within a page, and to output the return values. There is very scanty documentation on the usage of <xsql:dml> or <xsql:ref-cursor-function>.
    Any response would be greatly appreciated.
    Thanks,
    Raja

    Here is the example from the Oracle9i (complete rewrite) of the XSQL Chapter in our Oracle documentation.
    Question
    I using <xsql:dml> to call a stored procedure which has one OUT parameter, but I was not able to see any results. The executed code results in the following statement:
    <xsql-status action="xsql:dml" rows="0"/>
    Answer
    You cannot set parameter values by binding them in the position of OUT variables in this release using <xsql:dml>. Only IN parameters are supported for binding. You can create a wrapper procedure that constructs XML elements using the HTP package and then your XSQL page can invoke the wrapper procedure using <xsql:include-owa> instead.
    For an example, suppose you had the following procedure:
    CREATE OR REPLACE PROCEDURE addmult(arg1 NUMBER,
    arg2 NUMBER,
    sumval OUT NUMBER,
    prodval OUT NUMBER) IS
    BEGIN
    sumval := arg1 + arg2;
    prodval := arg1 * arg2;
    END;You could write the following procedure to "wrap" it, taking all of the IN arguments that the procedure above expects, and then "encoding" the OUT values as a little XML datagram that you print to the OWA page buffer:
    CREATE OR REPLACE PROCEDURE addmultwrapper(arg1 NUMBER, arg2 NUMBER) IS
    sumval NUMBER;
    prodval NUMBER;
    xml VARCHAR2(2000);
    BEGIN
    -- Call the procedure with OUT values
    addmult(arg1,arg2,sumval,prodval);
    -- Then produce XML that encodes the OUT values
    xml := '<addmult>'&#0124; &#0124;
    '<sum>'&#0124; &#0124;sumval&#0124; &#0124;'</sum>'&#0124; &#0124;
    '<product>'&#0124; &#0124;prodval&#0124; &#0124;'</product>'&#0124; &#0124;
    '</addmult>';
    -- Print the XML result to the OWA page buffer for return
    HTP.P(xml);
    END;This way, you can build an XSQL page like this that calls the wrapper procedure:
    <page connection="demo" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa bind-params="arg1 arg2">
    BEGIN addmultwrapper(?,?); END;
    </xsql:include-owa>
    </page>This allows a request like:
    http://yourserver.com/addmult.xsql?arg1=30&arg2=45
    to return an XML datagram that reflects the OUT values like this:
    <page> <addmult><sum>75</sum><product>1350</product></addmult>
    </page>

  • Getting question marks in html output when XML sourced from a CLOB...

    I have noticed a number of other unanswered questions on the
    same subject in this forum. Can someone at Oracle shed some
    light on this problem?...
    I store XML in CLOBS which contain a lot of &eacute; &ouml;
    characters. When using XSQL to select the XML from the CLOB I
    have to apply a stylesheet to the XSQL (myFile.xsql) with
    disable-output-escaping ="yes" in order to output well formed
    XML.
    I then call the XSQL file from inside another stylesheet i.e.
    <xsl:variable name="sample" select="document(myFile.xsql)"/>
    <xsl:template match="/">
    <xsl:for-each select="$sample">
    <html>
    <body>
    <title>
    <xsl:value-of select="/page/title"/>
    </title>
    </body>
    </html>
    etc...
    I use <xsl:for-each select="$sample"> to output the XML I need,
    within the HTML. The problem is though if "&eacute;" appears in
    the /page/title node the output in HTML appears as a question
    mark.
    Its important to note as well that the stylesheet I apply to
    myFile.xsql starts with:
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output doctype-system="/myFile.dtd" indent="yes"/>
    etc..
    and myFile.dtd has <!ENTITY eacute "&#x000E9;"> in order to
    validate &eacute; in the CLOB.
    I don't have this problem when the &eacute; character is stored
    in a VARCHAR2 column and the VARCHAR2 column is in the same
    select statement as the CLOB in the XSQL file. This outputs in
    my HTML just fine. What am I missing here?
    Shaun

    I parse the XML doc into a domdocument and then loop through using xpath.valueof to pull the individual values from the nodes and then build a generic insert. It works quite well with a small number of columns. I'm not sure how it would work with a lot of columns. You can get code examples from Steve Muench's book "Developing Oracle XML Applications".

  • XSQL file "Invalid at the top level of the document"

    I am trying to insert HTML form parameters into database using <xsql:insert-request>. It worked fine except that it displays <xsql-status action="xsql:insert-request" rows="1"/> after it inserts the data into the database. I am trying to follow the insertnewsform example in Steve's book "building oracle xml applications" to return user a thank-you note. Here is my problem:
    I have four files:
    faqform.html (html form, action=faqfeed.xsql)
    faqfeed.xsql
    request-to-faq.xsl (used as transform for faqfeed.xsql)
    thankyou.xsl (used for returning user a thank-you)
    When I submit the html form, I get an error saying:
    "The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Line 1, Position 43
    <?xml version = '1.0' encoding = 'UTF-8'?>"
    I didn't put "encoding..." in any of my xsql files, not sure where that came from. When I used faqfeed.xsql?xml-stylesheet=none in the url and it showed up as a well-formed xml file with all the info I need. Here is my faqfeed.xsql and thankyou.xsl
    ********* faqfeed.xsql ***********
    <?xml version="1.0"?>
    <?xml-stylesheet type="text/xsl" href="thankyou.xsl"?>
    <page connection="template" xmlns:xsql="urn:oracle-xsql">
    <xsql:insert-request table="faq" transform="request-to-faq.xsl"/>
    <xsql:query tag-case="lower" max-rows="5" rowset-element="" row-element="faq">
    select * from faq
    </xsql:query>
    </page>
    ********* thankyou.xsl **********
    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <head><title>Thank you!</title></head>
    <body>
    <h3>Thank you for your faq!</h3>
    Your faq has been successfully inserted to the database!
    <table>
    <xsl:for-each select="page/faq">
    <tr>
    <td><xsl:value-of select="question"/></td>
    <td><xsl:value-of select="answer"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    Anything I am missing here that caused that error? Any hints would be greatly appreciated!
    Wenqi
    null

    Do the XSQL Demos work correctly on your system?
    The error you're getting seems like maybe the *.xsql extension is not mapped properly to the oracle.xml.xsql.XSQLServlet class in your servlet engine.

Maybe you are looking for

  • Apache2 problems

    I recently attempted to enable cgi and php on my macbooks local webserver. In attempting to do this, my entire server stopped working. When I try to access the local site, I get the following error: Though the site seems valid, the browser was unable

  • Void Warranty From Opening?

    Was just wondering if just cracking off the back of the nano but not unscrewing anything will void my warranty. Just taking the back off and slapping it back on. How could they tell anyways. I have the apple warranty along with a 2 year retail store

  • Find feature in Adobe Reader

    How do I use the Find feature in Adobe Reader?  I used the Print PDF feature then copied the file from a Windows 7 computer to a CD-ROM and am trying to use it on a Windows 8 computer.  The file opens but I cannot use the Find feature.  Please help a

  • Vendor Master Data Transfer Between the Clients

    Hello Everyone, I want to transfer Vendor master data between the clients, can any one help me in this Please? I don't want to use LSMW, Is there any other method by which i can copy the vendor between the clients or i have to do it manually? Please

  • Sound Blaster Live! 24-Bit I

    Does anyone have this and can they please upload it's A link posted here returns a "Corrupted ISO". I really need this because I lost my CD.