Help me on CVP class to query a SQL database

Dear friends,
I try to create a class extends to Action element. But when I do deploy, it return no result.
I want this class receive Calling Number and do the query to database (SQL as I test, later if it works I will do for another database). After query I will get Name, Address, Email of this Customer based on Calling Number (ANI).
Please help to take a look on my program and help me to fix it.
Thank you very much.
import com.audium.server.AudiumException;
import com.audium.server.voiceElement.ActionElementBase;
import com.audium.server.session.ActionElementData;
import java.sql.*;
* This class is called when a standard action has been configured to use a
* Java class. Since this is a standard action element, it applies to a
* specific application and does not have a configuration. As a result, the
* only method needed in this class is the doAction method.
public class DBLookupStandardAction extends ActionElementBase
class WhatIGot
String ANI = null;
String Name = null;
String Address = null;
String Email = null;
public void doAction(String name, ActionElementData data) throws AudiumException
Connection conn = null;
String Name = null;
String Address = null;
conn = connectToDatabase();
String ani = data.getAni();
WhatIGot whatigot = new WhatIGot();
whatigot = QueryDatabase(conn, ani);
Name = whatigot.Name;
Address = whatigot.Address;
data.setSessionData("Name",Name);
data.setSessionData("Address",Address);
// PUT YOUR CODE HERE.
private Connection connectToDatabase()
Connection conn = null;
try
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn = DriverManager.getConnection("jdbc:sqlserver://172.16.3.5:1433;DatabaseName=hcmpt","sa","");
catch (ClassNotFoundException e)
e.printStackTrace();
System.exit(1);
catch (SQLException e)
e.printStackTrace();
System.exit(2);
return conn;
/*Query*/
private WhatIGot QueryDatabase(Connection conn, String ANI)
WhatIGot WhatIGot = new WhatIGot();
try
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT prefixnos, Name, Address, Email FROM customer_info where prefixnos = ANI");
WhatIGot.ANI = rs.getString ("prefixnos");
WhatIGot.Name = rs.getString ("Name");
WhatIGot.Address = rs.getString ("Address");
WhatIGot.Email = rs.getString ("Email");
rs.close();
st.close();
catch (SQLException se) {
System.err.println("Threw a SQLException creating the list of blogs.");
System.err.println(se.getMessage());
return WhatIGot;

Thank you Geoff,
I have made some changes and now it's working fine with SQL database.
I go forward to Oracle database. But can you show me how can I copy a new library (ojdbc14.jar) to the CVP server:
- which folder?
- and how apply it for all other application can use the same lib here?
waiting for you answer...
Thank you,
This code I have tested, it can connect and query and I try to put to screen. It is working. But when I apply to CVP xml server, it not work. And the CVP VXML server got "stop" (maybe on the fail state)
package com.dts.db;
* @author Doan Khanh Tan Thanh
// These classes are used by standard action elements.
import com.audium.server.AudiumException;
import com.audium.server.voiceElement.ActionElementBase;
import com.audium.server.session.ActionElementData;
import java.sql.*;
* This class is called when a standard action has been configured to use a
* Java class. Since this is a standard action element, it applies to a
* specific application and does not have a configuration. As a result, the
* only method needed in this class is the doAction method.
public class OracleDBLookupAction extends ActionElementBase
class WhatIGot
String Name = null;
String Address = null;
String Email = null;
public void doAction(String name, ActionElementData data) throws AudiumException
String NameWhatIGot = null;
Connection conn = null;
String AddressWhatIGot = null;
//String EmailWhatIGot = null;
String ani = null;
conn = connectToDatabase();
ani = (String)data.getSessionData("ANI");
WhatIGot whatigot = new WhatIGot();
whatigot = QueryDatabase(conn, ani);
NameWhatIGot = whatigot.Name;
AddressWhatIGot = whatigot.Address;
//EmailWhatIGot = whatigot.Email;
data.setSessionData("Name",NameWhatIGot);
data.setSessionData("Address",AddressWhatIGot);
// PUT YOUR CODE HERE.
private Connection connectToDatabase()
Connection conn = null;
try
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:thin:@172.16.5.134:1521:dbkttt","CUOC1080","123456");
catch (ClassNotFoundException e)
e.printStackTrace();
System.exit(1);
catch (SQLException e)
e.printStackTrace();
System.exit(2);
return conn;
/*Query*/
private WhatIGot QueryDatabase(Connection conn, String ANI)
WhatIGot WhatIGot = new WhatIGot();
try
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM CUSTOMER_INFO where ANI = '838232822'");
while ( rs.next() )
WhatIGot.Name = rs.getString ("NAME");
WhatIGot.Address = rs.getString ("ADDRESS");
WhatIGot.Email = rs.getString ("EMAIL");
rs.close();
st.close();
catch (SQLException se) {
System.err.println("Threw a SQLException creating the list of blogs.");
System.err.println(se.getMessage());
return WhatIGot;

Similar Messages

  • Need Help/Advice with Photo Web Gallery coming from SQL Database

    This is my first attempt at a database driven website. I assume what I am trying to accomplish should be fairly easy for more experienced but I am stuck at this point.
    First, let me explain what I am trying to accomplish.
    I want to create a thumbnail photo gallery displayed in columns and rows. I want to be able to hover over or click on the thumbnail image and have a lightbox script display the image over the thumb page. I am developing locally right now with intent to upload to the hosting site upon completion.
    I am developing with ASP vbScript pages. I have an SQL database where the paths to the image thumbnails and pictures are stored in a table. On the gallery page, I have created a div tag to hold my image recordset. Within this div, I have inserted 3 absolute positioned divs to hold the pictureID, the pictureName and the image inserted as a datasource. I then inserted the information from the bindings panel of my recordset. Last, I used a horizontal looper extension from Tom Muck to get the thumbnails to display in columns and rows. Everything works up to this point just fine.
    Now, I want to be able to hover or click on a thumnail image and have it displayed in a lightbox. I downloaded and used a javascript called Lightbox 2 which contains 3 javascript files and a css stylesheet. I inserted the files into the head tag like instructed to but could not get things to work properly. Here is where I need help. Currently, I am clicking on the thumbImage binding within the image Div and creating a link holder. I am then binding the larger pictureImage to it with the a.href selected in the bind to. I am then adding the command to call the lightbox javascript. Now, when I test my page, my thumbnail images do not show up (my alt text does in its place) but the links are in place and you can click on the alt text and it will return the correct larger image, but not in the lightbox, just in a new window with no styles.
    Am I going about this correctly? Can you use lightbox scripts with data-driven galleries? Does anybody have any suggestions of what I may be doing wrong or missing? Are there better ways to go about accomplishing this?
    Any help would be appreciated as this dynamic data thing has my head spinning. Although I know a database is needed to simplify the update and maintenance of the photos while allowing them to be searchable by keywords and tags also set up in the database.
    Thanks

    As I explained, I am developing locally a the moment. I will see about getting the databased moved up to the hosting server and then provide a link for an example.
    In the mean time, can you or anyone else explain a way that you would go about displaying an image thumbnail photo gallery laid out in rows / columns, with any lighbox script that would overlay the larger image over the existing page instead of opening a new browser window?
    I don't have to use the method I tried to describe.
    In all of the lightbox examples I have looked at thus far, they give instructions on how to append that javascript to a single static image or a group of static images, not images from a datasource. That is where I am getting confused.
    Don't know if this will help or not but please see code below:
    Javascript and CSS positioned in head tag
    <!--beginning of lightbox script with css -->
    <link href="CSS/lightbox.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/protype.js" type="text/javascript"></script>
    <script src="Scripts/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    <script src="Scripts/lightbox.js" type="text/javascript"></script>
    <!--end of lightbox script with css -->
    Calling for javascript in the galleryimage div when hovering over thumbnail image
        <!--beginning of gallery div -->
        <div id="gallery">
          <p>
            <!--beginning of galleryImage div -->
          </p>
          <table width="400" border="0" align="center" id="galleryNav2">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
          <p> </p>
          <table align="center" id="HorzLooper">
            <%
    startrw = 0
    endrw = HLooper1__index
    numberColumns = 5
    numrows = 5
    while((numrows <> 0) AND (Not rs_ssfGallery.EOF))
    startrw = endrw + 1
    endrw = endrw + numberColumns
    %>
            <tr align="center" valign="top">
              <%
    While ((startrw <= endrw) AND (Not rs_ssfGallery.EOF))
    %>
              <td><div id="galleryImage">
                <div id="galleryThumb"><a href="images/pic/<%=(rs_ssfGallery.Fields.Item("picture_url").Value)%>"rel="lightbox"><img src="images/thumb/<%=(rs_ssfGallery.Fields.Item("thumb_url").Value)%>" alt="<%=(rs_ssfGallery.Fields.Item("alt_url").Value)%>" /></a></div>
                <div id="galleryImageID"><%=(rs_ssfGallery.Fields.Item("picture_ID").Value)%></div>
                <div id="galleryImageFamily"><%=(rs_ssfGallery.Fields.Item("family").Value)%></div>
              </div></td>
              <%
    startrw = startrw + 1
    rs_ssfGallery.MoveNext()
    Wend
    %>
            </tr>
            <%
    numrows=numrows-1
    Wend
    %>
          </table>
          <p> </p>
          <table width="400" border="0" align="center" id="galleryNav">
            <tr>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_moveFirst%>">First</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If MM_offset <> 0 Then %>
                  <a href="<%=MM_movePrev%>">Previous</a>
              <% End If ' end MM_offset <> 0 %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveNext%>">Next</a>
              <% End If ' end Not MM_atTotal %></td>
              <td width="100" align="center"><% If Not MM_atTotal Then %>
                  <a href="<%=MM_moveLast%>">Last</a>
              <% End If ' end Not MM_atTotal %></td>
            </tr>
          </table>
    <!--end of galleryImage div -->
        </div>
        <!--end of gallery div -->
    Thanks for any help or suggestions.

  • How to connect and query the sql database in mobile application

    Hello,
    Can any one say how to connect the sql database from the j2me application.
    I have got some info that only through servlet or jsp only we can connect the database and from their we should get the info or query in mobile application.
    Is it true? and can i have any sample codes or white paper or guildlines.
    It would be more useful form my project.
    Thanks in advance.
    regards,
    sara

    Hi David,
    According to your description, when you add Windows Azure Mobile Services to a Window Phone 8 app, then store app data in the new mobile service. I recommend you post the related question on the Windows Azure Mobile Services Forums at
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=azuremobile .It is appropriate and more experts will assist you.
    In addition, there are the details about creating a Windows Phone app connected to your mobile service.
    http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-wp8/
    http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-data-wp8/
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to query a sql database table from webdynpro?

    Hi All,
    Can someone tell me the steps involved in accessing a sql server database table and retrieving the record set from a webdynpro application.
    Thanks in advance.
    Best regards,
    Divya

    Hello Divya,
    I would recommend you to read "Java Persistence" section in Development manual describing various options for database integration http://help.sap.com/saphelp_nw04/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm
    Tutorials
    http://help.sap.com/saphelp_nw04/helpdata/en/46/ddc4705e911f43a611840d8decb5f6/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm
    Web serices
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/f9bc3d52f39d33e10000000a11405a/frameset.htm
    EJB
    http://help.sap.com/saphelp_nw04/helpdata/en/19/f9bc3d8af79633e10000000a11405a/frameset.htm
    Best regards, Maksim Rashchynski.

  • Querying an SQL Database from ABAP

    Is is possible from within ABAP in R/3 (or NetWeaver) to query a non-SAP database? For example, can I write ABAP code which will go after data in say a non SAP DB2 database at some remote location?
    Kevin

    Hi
    Connecting to an External database from SAP
    Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
    Table: DBCON (Description of Database Connections)
    Field Name Description Value (For: E.g.:)
    CON_NAME Logical name for a database connection RAJ
    DBMS Database system MSS
    USER_NAME Database user <username>
    PASSWORD Password for setting up the connection to the database <pwd>/<pwd>
    CON_ENV Database-specific information for a database connection MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
    DB_RECO Availability type for an open database connect  
    Step 2: Now you can write code to connect to the external database…
    Your Sample code can be something like this……
    DATA: BEGIN OF wa,
    c_locid(3),
    c_locname(50),
    c_locstate(5),
    END OF wa.
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    *- Get the data from MS-SQL Server
    EXEC SQL.
    open C1 for
    select
    loc_id,
    loc_name,
    loc_state
    from ho_loc_mast
    ENDEXEC.
    DO.
    EXEC SQL.
    FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate
    ENDEXEC.
    IF sy-subrc = 0.
    PERFORM loop_output.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    EXEC SQL.
    CLOSE C1
    ENDEXEC.
    *& Form LOOP_OUTPUT
    Output
    FORM loop_output .
    WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.
    CLEAR wa.
    ENDFORM. " LOOP_OUTPUT
    Regards
    Raj

  • Query SQL database with Crystal

    I have a crystal report that is a production work order from our ERP system Macola ES.  The user enters the work order in Macola then prints it.  The user will input a work order number and the report will populate multiple fields from that work order.  To be specific I am trying to add a field on the report that will display the most recently entered batch number for the item number that is in the work order.
    item_no = Field 7 in the report
    The t-sql below above achieves what I would like to display on the report when searching the database.  The text after /* and before */ are my comments.
    /* Search for the most recent order entered in the ppordfil_sql database
    where the item number equals Field7 */
    select top 1
    cus_name /* Batch number field */
    from dbo.ppordfil_sql
    where ppordfil_sql.item_no = "Crystal Report Field 7"
    order by entered_dt desc

    Yes Macola is partner of ours.  However, they are not going to write the Crystal Report for us.  The question I am asking is how I can query an SQL database to display and create a query of the SQL data in my report.  I know how to write the t-sql as shown above.  The field "Crystal Report Field 7" is the field I would like to base my query off.  I was hoping someone could point me in the right direction with using a combination of a command object and a parameter.

  • Help with translating SQL query from SQL Server syntax to Oracle syntax

    Hi,
    is it someone that can help me translate following SQL query from SQL Server syntax to Oracle syntax.
    SELECT ID,
    [LMT(MTR)] = MAX(case when TYPE = 'LMT' then VALUE end),
    [AAD(KGM)] = MAX(case when TYPE = 'AAD' then VALUE end),
    [VOL(MTQ)] = MAX(case when TYPE = 'VOL' then VALUE end)
    FROM yourtable
    GROUP BY ID
    Your help is highly appreciated, thanks in advance.

    Like this,
    SELECT ID,
    MAX(case when TYPE = 'LMT' then VALUE end) LMT_MTR,
    MAX(case when TYPE = 'AAD' then VALUE end) AAD_KGM ,
    MAX(case when TYPE = 'VOL' then VALUE end) VOL_MTQ
    FROM yourtable
    GROUP BY ID-Arun

  • Please help!!! Tuning the query

    Hi,
    I am using Oracle BDBXML 2.4.16. In the following, policyContainer.dbxml has around 1000 documents and productsContainer.dbxml around 10 documents. The following query is taking around 6 - 8 seconds to fetch the data of around 300 records. I have created node-element-equality-string indexes on PolicyEvent, PolicyStatus, Archived, IsLatest, ProductID and CompanyID.
    I am novice on Query tuning. Can someone please help me to tune the following query. I have posted the query plan as well.
    Thanks in Advance!!
    Balakrishna.
    Query:
    query ' for $policy in collection("policyContainer.dbxml")/Policy[PolicyState/PolicyEvent=("APPLICATION","QUOTE","BINDER","POLICY","ENDORSEMENT QUOTE")]
    [PolicyHeader/ProductID = (for $product in collection("productsContainer.dbxml")/Product/ProductsHeader[CompanyID=(1)] return $product/ProductID)]
    [PolicyState/PolicyStatus !=("RATE","DECLINED ENDORSEMENT QUOTE","DECLINED NON-PRE ENDORSEMENT QUOTE","DECLINED EXTENSION QUOTE")]
    [PolicyState/Archived !="true"]
    [(PolicyState/IsLatest !="false"
    and (PolicyState/PolicyStatus != ("ENDORSEMENT QUOTE","NON-PRE ENDORSEMENT QUOTE","EXTENSION QUOTE")))
    or (PolicyState/IsLatest !="true"
    and (PolicyState/PolicyStatus =("ENDORSEMENT QUOTE","NON-PRE ENDORSEMENT QUOTE","EXTENSION QUOTE")))]
    let $state := $policy/PolicyState 
    let $header := $policy/PolicyHeader
    let $datatable := $policy/DataTable/DataTableInfo
    return
    <policyDetail>
    {$policy/SubmissionNumber},
    {$policy/DocumentNumber},
    {$policy/QuoteVersionNumber},
    {$state/*,$header/*,$datatable/*}
    </policyDetail>'
    Query plan:
    <XQuery>
      <Return>
        <LetTuple uri="" name="datatable">
          <LetTuple uri="" name="header">
            <LetTuple uri="" name="state">
              <ForTuple uri="" name="policy">
                <ContextTuple/>
                <QueryPlanToAST>
                  <BufferQP id="2">
                    <NegativeNodePredicateFilterQP uri="" name="#tmp67">
                      <NegativeNodePredicateFilterQP uri="" name="#tmp73">
                        <NodePredicateFilterQP uri="" name="#tmp404">
                          <ParentOfChildJoinQP>
                            <StepQP axis="parent-of-child" name="PolicyState" nodeType="element">
                              <UnionQP>
                                <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyEvent" value="ENDORSEMENT QUOTE"/>
                                <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyEvent" value="APPLICATION"/>
                                <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyEvent" value="POLICY"/>
                                <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyEvent" value="BINDER"/>
                                <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyEvent" value="QUOTE"/>
                              </UnionQP>
                            </StepQP>
                            <StepQP axis="child" name="Policy" nodeType="element">
                              <SequentialScanQP container="policyContainer.dbxml" nodeType="document"/>
                            </StepQP>
                          </ParentOfChildJoinQP>
                          <ValueFilterQP comparison="eq" general="true">
                            <StepQP axis="child" name="ProductID" nodeType="element">
                              <StepQP axis="child" name="PolicyHeader" nodeType="element">
                                <VariableQP name="#tmp404"/>
                              </StepQP>
                            </StepQP>
                            <Atomize>
                              <Return>
                                <ForTuple uri="" name="product">
                                  <ContextTuple/>
                                  <QueryPlanToAST>
                                    <ParentOfChildJoinQP>
                                      <ValueFilterQP comparison="eq" general="true">
                                        <PresenceQP container="productsContainer.dbxml" index="node-element-equality-string" operation="prefix" child="CompanyID"/>
                                        <Sequence>
                                          <NumericTypeConstructor value="1.0E0" typeuri="http://www.w3.org/2001/XMLSchema" typename="integer"/>
                                        </Sequence>
                                      </ValueFilterQP>
                                      <StepQP axis="child" name="ProductsHeader" nodeType="element">
                                        <StepQP axis="child" name="Product" nodeType="element">
                                          <SequentialScanQP container="productsContainer.dbxml" nodeType="document"/>
                                        </StepQP>
                                      </StepQP>
                                    </ParentOfChildJoinQP>
                                  </QueryPlanToAST>
                                </ForTuple>
                                <QueryPlanToAST>
                                  <StepQP axis="child" name="ProductID" nodeType="element">
                                    <VariableQP name="product"/>
                                  </StepQP>
                                </QueryPlanToAST>
                              </Return>
                            </Atomize>
                          </ValueFilterQP>
                        </NodePredicateFilterQP>
                        <ValueFilterQP comparison="ne" general="true">
                          <ValueFilterQP comparison="ne" general="true">
                            <ValueFilterQP comparison="ne" general="true">
                              <ValueFilterQP comparison="ne" general="true">
                                <StepQP axis="child" name="PolicyStatus" nodeType="element">
                                  <StepQP axis="child" name="PolicyState" nodeType="element">
                                    <VariableQP name="#tmp73"/>
                                  </StepQP>
                                </StepQP>
                                <Sequence>
                                  <AnyAtomicTypeConstructor value="RATE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                  <AnyAtomicTypeConstructor value="DECLINED ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                  <AnyAtomicTypeConstructor value="DECLINED NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                  <AnyAtomicTypeConstructor value="DECLINED EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                </Sequence>
                              </ValueFilterQP>
                              <Sequence>
                                <AnyAtomicTypeConstructor value="RATE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                <AnyAtomicTypeConstructor value="DECLINED ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                <AnyAtomicTypeConstructor value="DECLINED NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                <AnyAtomicTypeConstructor value="DECLINED EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              </Sequence>
                            </ValueFilterQP>
                            <Sequence>
                              <AnyAtomicTypeConstructor value="RATE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              <AnyAtomicTypeConstructor value="DECLINED ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              <AnyAtomicTypeConstructor value="DECLINED NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              <AnyAtomicTypeConstructor value="DECLINED EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            </Sequence>
                          </ValueFilterQP>
                          <Sequence>
                            <AnyAtomicTypeConstructor value="RATE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            <AnyAtomicTypeConstructor value="DECLINED ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            <AnyAtomicTypeConstructor value="DECLINED NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            <AnyAtomicTypeConstructor value="DECLINED EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                          </Sequence>
                        </ValueFilterQP>
                      </NegativeNodePredicateFilterQP>
                      <ChildJoinQP>
                        <StepQP axis="child" name="PolicyState" nodeType="element">
                          <VariableQP name="#tmp67"/>
                        </StepQP>
                        <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="Archived" value="true"/>
                      </ChildJoinQP>
                    </NegativeNodePredicateFilterQP>
                    <UnionQP>
                      <NegativeNodePredicateFilterQP uri="" name="#tmp18">
                        <NegativeNodePredicateFilterQP uri="" name="#tmp46">
                          <BufferReferenceQP id="2"/>
                          <ChildJoinQP>
                            <StepQP axis="child" name="PolicyState" nodeType="element">
                              <VariableQP name="#tmp46"/>
                            </StepQP>
                            <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="IsLatest" value="false"/>
                          </ChildJoinQP>
                        </NegativeNodePredicateFilterQP>
                        <ValueFilterQP comparison="ne" general="true">
                          <ValueFilterQP comparison="ne" general="true">
                            <ValueFilterQP comparison="ne" general="true">
                              <StepQP axis="child" name="PolicyStatus" nodeType="element">
                                <StepQP axis="child" name="PolicyState" nodeType="element">
                                  <VariableQP name="#tmp18"/>
                                </StepQP>
                              </StepQP>
                              <Sequence>
                                <AnyAtomicTypeConstructor value="ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                <AnyAtomicTypeConstructor value="NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                                <AnyAtomicTypeConstructor value="EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              </Sequence>
                            </ValueFilterQP>
                            <Sequence>
                              <AnyAtomicTypeConstructor value="ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              <AnyAtomicTypeConstructor value="NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                              <AnyAtomicTypeConstructor value="EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            </Sequence>
                          </ValueFilterQP>
                          <Sequence>
                            <AnyAtomicTypeConstructor value="ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            <AnyAtomicTypeConstructor value="NON-PRE ENDORSEMENT QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                            <AnyAtomicTypeConstructor value="EXTENSION QUOTE" typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
                          </Sequence>
                        </ValueFilterQP>
                      </NegativeNodePredicateFilterQP>
                      <NegativeNodePredicateFilterQP uri="" name="#tmp56">
                        <ParentOfChildJoinQP>
                          <StepQP axis="parent-of-child" name="PolicyState" nodeType="element">
                            <UnionQP>
                              <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyStatus" value="NON-PRE ENDORSEMENT QUOTE"/>
                              <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyStatus" value="EXTENSION QUOTE"/>
                              <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="PolicyStatus" value="ENDORSEMENT QUOTE"/>
                            </UnionQP>
                          </StepQP>
                          <BufferReferenceQP id="2"/>
                        </ParentOfChildJoinQP>
                        <ChildJoinQP>
                          <StepQP axis="child" name="PolicyState" nodeType="element">
                            <VariableQP name="#tmp56"/>
                          </StepQP>
                          <ValueQP container="policyContainer.dbxml" index="node-element-equality-string" operation="eq" child="IsLatest" value="true"/>
                        </ChildJoinQP>
                      </NegativeNodePredicateFilterQP>
                    </UnionQP>
                  </BufferQP>
                </QueryPlanToAST>
              </ForTuple>
              <QueryPlanToAST>
                <StepQP axis="child" name="PolicyState" nodeType="element">
                  <VariableQP name="policy"/>
                </StepQP>
              </QueryPlanToAST>
            </LetTuple>
            <QueryPlanToAST>
              <StepQP axis="child" name="PolicyHeader" nodeType="element">
                <VariableQP name="policy"/>
              </StepQP>
            </QueryPlanToAST>
          </LetTuple>
          <QueryPlanToAST>
            <StepQP axis="child" name="DataTableInfo" nodeType="element">
              <StepQP axis="child" name="DataTable" nodeType="element">
                <VariableQP name="policy"/>
              </StepQP>
            </StepQP>
          </QueryPlanToAST>
        </LetTuple>
        <DOMConstructor type="element">
          <Name>
            <Sequence>
              <ATQNameConstructor uri="" prefix="" localname="policyDetail" typeuri="http://www.w3.org/2001/XMLSchema" typename="QName"/>
            </Sequence>
          </Name>
          <Children>
            <ContentSequence>
              <QueryPlanToAST>
                <StepQP axis="child" name="SubmissionNumber" nodeType="element">
                  <VariableQP name="policy"/>
                </StepQP>
              </QueryPlanToAST>
            </ContentSequence>
            <ContentSequence>
              <Sequence>
                <AnyAtomicTypeConstructor value="," typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
              </Sequence>
            </ContentSequence>
            <ContentSequence>
              <QueryPlanToAST>
                <StepQP axis="child" name="DocumentNumber" nodeType="element">
                  <VariableQP name="policy"/>
                </StepQP>
              </QueryPlanToAST>
            </ContentSequence>
            <ContentSequence>
              <Sequence>
                <AnyAtomicTypeConstructor value="," typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
              </Sequence>
            </ContentSequence>
            <ContentSequence>
              <QueryPlanToAST>
                <StepQP axis="child" name="QuoteVersionNumber" nodeType="element">
                  <VariableQP name="policy"/>
                </StepQP>
              </QueryPlanToAST>
            </ContentSequence>
            <ContentSequence>
              <Sequence>
                <AnyAtomicTypeConstructor value="," typeuri="http://www.w3.org/2001/XMLSchema" typename="string"/>
              </Sequence>
            </ContentSequence>
            <ContentSequence>
              <Parenthesized>
                <QueryPlanToAST>
                  <ChildJoinQP>
                    <VariableQP name="state"/>
                    <SequentialScanQP container="policyContainer.dbxml" nodeType="element"/>
                  </ChildJoinQP>
                </QueryPlanToAST>
                <QueryPlanToAST>
                  <StepQP axis="child" uri="*" name="*" nodeType="element">
                    <VariableQP name="header"/>
                  </StepQP>
                </QueryPlanToAST>
                <QueryPlanToAST>
                  <ChildJoinQP>
                    <VariableQP name="datatable"/>
                    <SequentialScanQP container="policyContainer.dbxml" nodeType="element"/>
                  </ChildJoinQP>
                </QueryPlanToAST>
              </Parenthesized>
            </ContentSequence>
          </Children>
        </DOMConstructor>
      </Return>
    </XQuery>

    The good news is that your indexes are being used (anywhere in the query plan where you see index="node-element-equality-string"), the bad news is that the entire policyContainer is being scanned several times (<SequentialScanQP container="policyContainer.dbxml" nodeType="element"/>). Your best bet is to upgrade to dbxml-2.5.16, since that has several improvements to the optimizer that should optimize away those scans. Failing that, use the shell command (dbxml) to add and remove indexes and see how that changes the query plan and speed. The following line is what is causing the scans:
    {$state/*,$header/*,$datatable/*}So add indexes that will help to locate those nodes, or change that line so that the query is faster.
    Lauren Foutz

  • F4 Help in ALV GRID class based

    hi
    you have any idea about how to invoke the F4 help in ALV GRID Class based program.,
    if u have any other related document or program using F4 function in ALV GRId please send to me for reference
    Thanks & Regards
    K.G

    hi for what kind of fields you need to give f4.
    are they std or custom...
    please let me know about the fields..
    try to check my logic which i gave in the below post..
    it will give f4 help to the fields(if thet are standard table fieldS)
    Message was edited by: Vijay Babu Dudla

  • Hi I need help on URL Connection Class

    Hi
    I have read the documentation but cant get it . I have to Use the getContent(); method so can any one make a program for me in which all of the methods of this class have been used?
    I Also Need help on Content Handler Class Please give me one example on it but separate from the above one
    Thanx alot

    Hi
    Man Some Times We need help and as of google, Google is My Best Friend. and as of forums search i know that but some time we have less time and much to work. The Time Doesnt wait us. we have to save our time. thanx for ur help and ur comments i like it.

  • Help : documentation The Robot Class

    hi,
    is there somone who know about the robot class either the documentation of the API, some internet web site ..
    thanks

    What are you wanting to know?? I helped create the Robot class. This class was purposely kept extremely minimal, and the javadoc for it is pretty good. If you want a more complete tool, you can try Jemmy (http://jemmy.netbeans.org/), though I should warn you that the documentation there is skimpy. Jemmy builds on top of Robot and provides lots of flexibility.
    - David

  • Can anyone help me decompile a class file?

    Can anyone pls help me decompile a class file? I've used DJ decompiler and Cavaj decompiler to decompile it but both can't seem to decompile it successfully. How do I attach the class file here? Thanks in advance!

    Oh! Now I get it. So sorry I didnt intend for anybody
    to do something illegal/unethical. I dont know much
    about Java programming since I am very new to this
    language. I didnt know anything about obfuscating
    codes either. The reason why I was trying to
    decompile the said class file is because I wanted to
    check whether the hack program I downloaded ...That is completely contradictory.
    By the way, can you tell me how I can learn Jave programming
    without the aid of a book since I couldnt find one
    yet.Given the eleventy bachillionty kathousand books that exist on java programming, something tells me you haven't looked too hard for one.
    The best non-hard-copy source:
    www.google.com

  • Complex query using 'sql like' statement.

    Given the following basic class structure.
    public class Project {
         private String name;
         private Architecture architecture;
         private Resources resources;
         public Architecture getArchitecture();
         public void setArchitecture(Architecture architecture);
         public Resources getResources();
         public void setResources();
         public String getName();
         public void setName(String name);
    public Architecture {
         private String name;
         public String getName();
         public void setName(String name);
    public Resources {
         private String name;
         public String getName();
         public void setName(String name);
    we want to be able to do a query like:
         find all Projects where (Project.name.indexOf("a") > 0) &&
    (Project.architecture.name.indexof("b") > 0)
    In essence a "like" comparison across String properties of the JDO objects.
    Is it supported in KODO?? Anyone tried it out? Also, is it possible to
    generate SQL type query in KODO?
    rgds
    NK

    Note that this relies on a current bug in Kodo -- we should escape out the
    '%' character, but we don't.
    Some day, we'll fix that bug. But, before then, we will introduce a proper,
    supported mechanism for finding records that have a string field that
    contains some substring.
    -Patrick
    On 5/30/02 6:12 PM, "Andrew" <[email protected]> wrote:
    Hi,
    I wanted to perform a LIKE statement to get records where the partial string
    existed in a field -> eg. select a where a.field LIKE "SPRING" - 2 records,
    SpringSteen & MindSprings
    I did it like this:
    setFieldName("Spring");
    String sFilter = "field.startsWith(%\" + getFieldName() + \"%)"; -
    Extent anExtent = pm.getExtent(this.getClass(), true);
    Query aQuery = pm.newQuery(this.getClass(), anExtent, sFilter);
    return (Collection) aQuery.execute();
    Hope it helps. oh, don't know about the generating sql query.
    Nitin Kanani wrote:
    Given the following basic class structure.
    public class Project {
    private String name;
    private Architecture architecture;
    private Resources resources;
    public Architecture getArchitecture();
    public void setArchitecture(Architecture architecture);
    public Resources getResources();
    public void setResources();
    public String getName();
    public void setName(String name);
    public Architecture {
    private String name;
    public String getName();
    public void setName(String name);
    public Resources {
    private String name;
    public String getName();
    public void setName(String name);
    we want to be able to do a query like:
    find all Projects where (Project.name.indexOf("a") > 0) &&
    (Project.architecture.name.indexof("b") > 0)
    In essence a "like" comparison across String properties of the JDO
    objects.
    Is it supported in KODO?? Anyone tried it out? Also, is it possible to
    generate SQL type query in KODO?
    rgds
    NK
    Patrick Linskey [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Executing SQL query in portal database

    Hi ,
       I wish to do a simple POC . I need to create a table from NWDS , populate it with some data and then access the table data using an sql query . I am aware how to create a table but I am not sure where exactly to write the query .
    What I would like to understand is
    1) If I create a table where would that table get created (The database) ?
    2) Where would I write that query in NWDS ?
    3) How would I execute that query in that database ?
    Please help for the same .
    (Needless to say that I always award points )
    Regards
    Deepak Singh

    Hi Gopal ,
       Thanks for the reply .This is what I did . I am pasting the whole code of the class that I am using to do the POC .
    package com.gravity;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.util.Hashtable;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    /*import sun.jdbc.odbc.ee.DataSource;/
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class DataHandling {
    public static void DataPost(){
         Connection con = null ;
         try {
    Added code
            Hashtable env = new Hashtable();
              env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
              System.out.println("initial_context_factory put ");
              env.put(javax.naming.Context.PROVIDER_URL, "gms29:50004");
              System.out.println("provide_url put ");
              env.put(javax.naming.Context.SECURITY_PRINCIPAL, "j2ee_admin");
              System.out.println("security_principal put ");
              env.put(javax.naming.Context.SECURITY_CREDENTIALS, "gravity");
              env.put("domain", "true");
              env.put("force_remote", "true");
              System.out.println("security_credentials put ");
              InitialContext iCtxt = new InitialContext(env);
              System.out.println("Object made for initial context ");
              DataSource ds = (DataSource) iCtxt.lookup("jdbc/my_db");
              System.out.println("Datasource obtained ");
              try {
                   con = ds.getConnection();
                   Statement stmt = con.createStatement();
                        String query1 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('naveen',125188)";
                        String query2 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('deepak',125189)";
                        String query3 ="insert into EmpData (EMPCODE,EMPNAME) VALUES('rajeev',125190)";
                   stmt.executeUpdate(query1);
                   stmt.executeUpdate(query2);
                   stmt.executeUpdate(query3);
                  }catch (Exception e) {
                   e.printStackTrace();
             }catch (Exception e) {
                    e.printStackTrace();
                                         } finally {
                                            try {
                                            con.close();
                                                }catch (Exception e) {
                                                e.printStackTrace();
    public static void main (String[] args){
         System.out.println("Hello");
         DataPost();
    I have imported all the driver jar files and sapj2eeclient.jar in the classpath .
    Also the drivers found in the path
    172.16.161.11\usr\sap\EP1\DVEBMGS00\j2ee\cluster\server0\bin\ext\com.sap.portal.jdbcdrivers
    have all been added to the classpath .(Not sure if this is required)
    Let me know what you find wrong in my code and in the meanwhile I will try to implement what you suggested .
    Regards
    Deepak Singh

  • Query from sql to JPAQL

    Hello, i'm from Colombia, I don't speak inglish, but i have a question.
    i try make a query from my database, i have the mysql query but i don't know how is the JPQL Query.
    Mysql
    select distinct (i.codigo), count(ia.incidente) from incidente i left join incidentearchivo ia on (i.codigo = ia.incidente and ia.activo = true)
    where i.tipo = 'I'
    group by i.codigo
    order by i.consecutivo;
    i have this query and run fine in mysql but i need this query in JPQL to my application.
    very tanks for your help.

    The JPQL depends on your object model, so perhaps include the classes and their mappings.
    Assuming a Incidente and IncidenteArchivo class with a OneToMany it may be something like:
    Select distinct (i.codigo), count(ia.incidente) from Incidente i left join i.archivos ia
    where i.tipo = 'I' and ia.activo = true group by i.codigo order by i.consecutivo
    The main difference is that JPQL does not have an ON clause, joins are defined by the relationships. This could be an issue with the activo = true check.
    You can also use a native SQL query in JPA to use your existing SQL.
    James: http://www.eclipselink.org

Maybe you are looking for