Rookie...can't return results from JDBC query?

I am trying to get my web service to return results to the client from my JDBC query. They "try/catch statements sem to be in the way. I can't return anything within them or outside of them. Can someone tell me how I could get my results to return to where I want them to?
At present, all this does is return the value "Dummy" to my client. Shouldn't the value be reset by the results of the query coming in?
package hello;
import java.sql.*;
public class HelloImpl implements HelloIF {
String s2 = "Dummy";
public String sayHello(String s) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
catch( Exception e ) {
System.out.println("Failed to load driver.");
try {
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:liggy11/fisher@dligman:1521:dligman");
Statement stmt = conn.createStatement();
String query = "SELECT end_phrase FROM rap_lines WHERE start_phrase = '" + s + "'";
ResultSet rs = stmt.executeQuery(query) ;
while (rs.next()) {
s2 = rs.getString("end_phrase");
System.out.println("Got another row. s2 is now [" + s2 + "]");
catch( Exception e ) {
e.printStackTrace();
return new String(s2);

liggy11,
I believe the smart-ass forum is the most appropriate
place for replies such as yours. Excuse me while I
get with some honeys....
Peace in the middle east,
mrcheeks.
I'm Sorry Miss Jackson!

Similar Messages

  • Can we use Result from another query in Webi using Bex uery universe?

    Hi,
    Can we use Result from another query filter option in Webi to create a report using a Bex Query universe?
    I need to create a report using two universes, one is Bex Query Universe and the other is Orcle universe. I have two queries, one is using Oracle universe; the other using Bex Query universe. I need to pass the Oracle data from the Oracle query to the Bex Query query to get the matched data from SAP Bex query.
    I used Result from another query in the query filter panel for the query using Bex query universe. But I got an error saying that 'A filter contains a wrong value. you cannot run this query. (Error: WIS 00007). The data used in the filter on both sides are the same. they are char.
    I have tested by using two queries from the same Bex query universe to see if the Result from another query filter option works. And I got the same error.
    Has anyone run into the same issue and if this is possible and what should be the solution?
    Thanks in advance!
    Edited by: BO_Haiyan on Oct 6, 2010 3:47 PM

    In that situation:
    Create two queries : Oracle and BW query.
    @ Report:
    As you have to see result set from both the Dataproviders, correct? To achieve thise one must have common dimension objects to merge them at report and use Objects those are coming from both queries to use them in single Table/Report.
    Unless you don't use Merge Dimensions, you don't get a chane to use both queries objects in single Table/Report. (It will give tooltip saying: You can't drop here -- Incompatable Objects)
    In case, if you don't have common dimensions, change object definitions to Detail objects, for those required.
    Hope it helps you.
    Thank You!!

  • Strange results from JDBC  Query using a VARRAY

    Here's one for you experts:
    I have a 9i release 2 db set up, to which I connect via the JDBC thin
    driver. I have a JavaServer Pages application that needs to read a VARRAY
    from a table and then use the contents of the VARRAY. Here's the code in
    the JSP that does that:
    resultset=db.executeQuery
    ("SELECT IMAGE_lIST FROM PAGE_IMAGE_ARRAY WHERE PAGENAME = " +
    pagename);
    oracle.sql.ARRAY array =
    ((oracle.jdbc.driver.OracleResultSet)resultset).getARRAY(1);
    imageList = (String[])array.getArray();
    for(int count=0; count<imageList.length; count++)
    out.println("<p>The image at position " + count + " in the array is
    the image titled: " + imageList[count]);
    The JSP compiles and runs fine, but the output is as follows:
    The image at position 0 in the array is the image titled: 0x7465737431
    The image at position 1 in the array is the image titled: 0x7465737432
    The image at position 2 in the array is the image titled: 0x7465737433
    The image at position 3 in the array is the image titled: 0x7465737436
    A query using SQL*Plus verifies that the actual values of the elements of
    the array are 'test1', 'test2', 'test3', 'test6'. Notice that the last
    digit in the hex(?) output matches the last digit of the actual string.
    What's causing this? It looks like a data type mismatch, but I would have
    thought that such an error would have triggered a compile-time error.
    Any help is greatly appreciated.
    Regards,
    Dave Penn

    Dave,
    The following should help.
      1  select rawtohex('test1') val1,
      2  rawtohex('test2') val2
      3* from dual
    SQL> /
    VAL1       VAL2
    7465737431 7465737432
    SQL> select rawtohex('1') val1,
      2  rawtohex('2') val2
      3  from dual;
    VA VA
    31 32

  • How to use Results from Another Query for SAP BW universes

    Hi Everyone,
    I have two SAP BI universes.In my First universe I have Sales Doc no (dimension) and Orderqty (Measure) and in my second universe I have Sales Doc no(Dimension) and BillQty (Measure).
    Here in my first dataprovider I have 1200 rows of data and in second dataprovider I have 75,000 rows. The report should fetch only the BillQty details that matches to corresponding  Sales doc no in first data provider.
    I want to place all these fileds into a single report like as shown.
    (Datarpovider1)                (Datarpovider1)                    (Datarpovider2)
    *Sales Doc No*               Orderqty                           BillQty
    Here I am able to generate single report using merge dimension but it is leading to performance issues. I want to restrict the values at query level by passing the First dataprovider Sales doc no to second Data provider Sales doc number using Results from Anothery Query feature so that It can fetch only the matching records.
    I tried it but it was giving the follwing error:
    A filter contains a wrong value. You cannot run this query. (Error: WIS 00007)
    How Can I get rid of this error. Can we use Results from Anothery Query option for OLAP universe. Are there any limitation on it.
    All this I am doing in Webi Rich Client.
    Appreciate your help
    Thanks &in Advance
    Kiran Saka

    Hi Kiran,
    I think the filter has a wrong operand. For example, a filter with an empty constant, or a filter that deals with numeric values is defined with an alphanumeric value.Check out for this.
    Regards,
    Neeraj

  • I can't prevent Spotlight from returning results from emails and Safari

    Try as I might, I can't prevent Spotlight from returning results from emails and from Safari web browser history.
    I've toggled the two relevant boxes in the Spotlight system preferences, and rebuilt the index, but it still returns results from categories that I have deselected (like emails and webpages).
    The system preferences say "Only selected categories will appear in Spotlight search results". If only it were true!

    I think this could be a reason, your settings regarding indexing of mail messages didn't stick.
    I'm having other problems with security update 2008-005.
    It'd be interesting to know if OnyX is able to fix your problem again. Hopefully its doings survive the next update.

  • Return results from ADEP in AS3 Arrays, not ArrayCollections

    Hi all,
    Is there any way to force ADEP to return results from data services in simple AS3 Arrays, not ArrayCollections? Here are my situation:
    In my project I use ADEP Data Management Services. To connect to ADEP services we use RTMP channel defined in services-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
         <services>
              <service-include file-path="remoting-config.xml" />
              <service-include file-path="proxy-config.xml" />
              <service-include file-path="messaging-config.xml" />
              <service-include file-path="data-management-config.xml" />
              <service-include file-path="managed-remoting-config.xml" />
              <service class="fiber.data.services.ModelDeploymentService" id="model-deploy-service" />
              <default-channels>
                   <channel ref="my-rtmp"/>
              </default-channels>
         </services>
         <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
              <endpoint url="rtmp://{server.name}:1000" class="flex.messaging.endpoints.RTMPEndpoint"/>
              <properties>
                   <idle-timeout-minutes>20</idle-timeout-minutes>
                   <block-rtmpt-polling-clients>true</block-rtmpt-polling-clients>
                   <rtmpt-poll-wait-millis-on-client>0</rtmpt-poll-wait-millis-on-client>
              </properties>
         </channel-definition>
    </services-config>
    To manage data in database we defined data services in data-management-config.xml like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <service id="data-service" class="flex.data.DataService">
        <adapters>
            <adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
            <adapter-definition id="mr-java-dao" class="flex.data.adapters.ManagedRemotingDataAdapter" />
            <adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
        </adapters>
        <default-channels>
            <channel ref="my-rtmp"/>
        </default-channels>
        <destination id="SomeProduct.SomeItems">
            <adapter ref="java-dao" />
            <properties>
                <source>flex.data.assemblers.SQLAssembler</source>
                <scope>application</scope>
                <metadata>
                    <identity property="ID" />
                </metadata>
                <server>
                    <database>
                        <datasource>java:comp/env/jdbc/SP</datasource>
                    </database>
                    <actionscript-class>com.somecompany.classes.SomeCoolClass</actionscript-class>
                    <create-item>
                        <procedure name="SomeItems_Insert">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Division_ID#" />
                            <procedure-param property-value="#Salesrep_ID#" />
                            <procedure-param property-value="#Area_Code#" />
                            <procedure-param property-value="#Item_ID#" />
                        </procedure>
                        <id-query>SELECT IDENT_CURRENT('Work_Area_Item')</id-query>
                    </create-item>
                    <fill>
                        <name>all</name>
                        <procedure name="SomeItems_Get">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Last_Sync_Time#" />
                        </procedure>
                    </fill>
                    <update-item>
                        <procedure name="SomeItems_Update">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Division_ID#" />
                            <procedure-param property-value="#Salesrep_ID#" />
                            <procedure-param property-value="#Area_Code#" />
                            <procedure-param property-value="#Item_ID#" />
                       </procedure>
                    </update-item>
                    <delete-item>
                        <procedure name="SomeItems_Delete">
                            <procedure-param property-value="#Session_ID#" />
                            <procedure-param property-value="#Item_ID#" />
                        </procedure>
                    </delete-item>
                </server>
            </properties>
        </destination>
    </service>
    By default, ADEP returns results from SomeProduct.SomeItems destination to Flex side as ArrayCollection of SomeCoolClass instances but I need the data to be returned in simple AS3 Arrays. Recently, I found that there is small optional serialization configuration in channel-definition that should resolve my problem. So I updated my channel-definition in services-config.xml to this:
    <channel-definition id="my-rtmp" class="mx.messaging.channels.RTMPChannel">
         <endpoint url="rtmp://{server.name}:1000" class="flex.messaging.endpoints.RTMPEndpoint"/>
         <properties>
              <serialization>
                   <legacy-collection>true</legacy-collection>
              </serialization>
              <idle-timeout-minutes>20</idle-timeout-minutes>
              <block-rtmpt-polling-clients>true</block-rtmpt-polling-clients>
              <rtmpt-poll-wait-millis-on-client>0</rtmpt-poll-wait-millis-on-client>
         </properties>
    </channel-definition>
    However, result are still returned in ArrayCollections.
    Any ideas?
    Thanks in advance

    Thom Parker answered this here: http://forums.adobe.com/message/2614570#2614570
    Answer copied below:
    "The problem is that when the focus is on the text box
    it's in edit mode. It's only displaying the value interactively entered by
    the user, or as a consequence of the change event.  What you need to do is
    force the focus off of the text box in code.  You can do a little trick
    where you bounce it to a tiny transparent field, which then bounds the focus
    back so it doesn't look like the focus changed."
    What I ended up doing was calling up the dialog box, then using setfocus with no parameters to remove focus from the field, as follows:
    this.rawValue = this.dialogBoxFunction(this.rawValue); // passing current value so dialog box defaults to that value
    xfa.host.setFocus();
    Cheers,
    Marty.

  • Query on results from another query

    Post Author: Duncan1980
    CA Forum: Crystal Reports
    Is it possible to query on the results from another query.  I have a query that produces a list of document numbers.  I want to use the output from that query as the filter criteria in a another query in the same Universe. 
    The output from the first query can be as much as 2000, so it would be very time consuming to cut and paste these into a filter.
    Both reports are built, but can not figure out how to link the first report output to the filtering criteria on the second report.  I
    I am using business objects XI release 2 web intelligence 11.5.3.417 enterprise.

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

  • Forcing the ReadAllQuery to return results from DB instead of cache

    How can I programmatically setup a ReadAllQuery to always return results from DB instead of cache. I dont want to use session.refreshObject - as this will result in 2 lookups - first for the actual search from cache or db and then a second search on each object on the DB. I am using Toplink 11.1.1

    You can use,
    query.refreshIdentityMapResult()
    or,
    query.setShouldRefreshIdentityMapResult(true)
    James : http://www.eclipselink.org

  • How to Sort by the length of the returned value from a query.

    Hi,
    I was wondering if it is possible to sort by the length of the returned value from a query?
    For example if I want to get a list of people with the name 'Samuel', I would like to short by how short the length of the whole name is.
    Sort by length of the name in SQL
    Samuel Syda
    Samuel Indranaka
    Samuel Johnsons
    Samuel Longhenderson
    Thank you.

    Hi,
    Sorting is done by an ORDER BY clause at the end of the main query.
    In most cases, you can ORDER BY any expression, even f it is not in the SELECT clause.  In this case, it sounds like you just need:
    ORDER BY  LENGTH (name_column)
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Post your query, using an ORDER BY clause like the one above, and point out where that query is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Results from another Query - not available

    HI,
    My environment is Business Objects XI 3.1 SP2 Edge series , i have  below quereis with web Intelligence Reports
    1. not available  the functions/options  Results from another Query(Any) or Results from another Query(ALL) at Query Level.
    2. not getting list of Values for pronpt until i refresh values for prompt?
    Please suggest me is there any fix packs available for the same to availle that functionality.
    Best Regards,
    Reddeppa K

    not getting list of Values for pronpt until i refresh values for prompt?
    There is option called  "Automatic refresh before use"  for the object properties available in the universe designer.
    Please check the box for the object you are using for populating the list of values and export the universe.
    not available the functions/options Results from another Query(Any) or Results from another Query(ALL) at Query Level.
    There is a limitation for the query on query functionality that the both the queries can-not be from the OLAP universe.
    I guess the query which needs to be filtered should be built on universe from the relational data base.
    Regards,
    Rohit

  • Alternative for result from other query  and merge dimension option option

    Hi Everyone ,
    Am Developing one webi report over bex Query.
    Actual scenario is output of one webi report should be the input of other webi report.
    Eg:
    Table 1
    2010        Cus 1
    2010        Cus 2
    2011        Cus 3
    table 2
    cus1    m1   100
    cus2    m2   200
    Cus3    m1  400
    Report 1 designing 
    First report created using table 1 and prompt for year
    Report  2 designing
    Second report created using table2 and prompt for customer
    So when am Running first report it will ask for parameter year and if am selecting 2010 then the report will return C1 and C2
    this out put should e the input for report 2.
    So out put will be 100+200=300
    NOTE:1. Result from other query is not working in webi filter pane since am building on olap universe.
               2. Merge Dimension performance is very slow .
    Any Solution ?
    Regards,
    Kannan.B

    Hi,
    Thanks for ur reply
    As you said , If am giving hyperlink to other report .
    Eg: User selected Tamilnadu then report 1 opened  then  he has to click the some cell or hyperlink cell to view the actual report(2nd report).
    Suppose user Clicked that hyperlink cell and 2nd report opened and he is viewing the data for Tamil nadu and he decided to see the report for
    Andrapradesh so according to this logic he has to select first report and refresh the data for Andra and from there he has to come to 2nd report.
    totally 4 screen will be opened for seeing the two states report.
    So Some other alternative.......

  • Issue with Results from Another Query (Error on Null value)

    Hi All,
    We have a WebI report using "Result from Another Query" option of BO XI R3.1. The report was running fine till recently the dimension object using result from another query had a null value. Report suddenly throwed error as the query filters are invalid.
    Is there a way to make this filter optional if no data/null value is there ? Because we need those null values in report as well.
    Thank you for your time.
    Thanks & Regards
    LN

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

  • Combine query, result from another query on SAP BI query Universe?

    Hello all,
    We are using SAP BI queries as datasource for our universes. Is the combined query option disabled for webi reports written on such universes?
    result from another query - is this option active for such webi reports? I see both these options greyed out so wanted to check.
    One last thing what is really difference between subquery and results from another query? subquery - you can use filters from that one data provider only right? or can you use a different data provider/report in sub query?
    Thanks a lot for all the replies.

    Hi,
    in BO 3.1 Combined query and result from another query options are not available in webi report on OLAP Universes  (SAP BW Universe.)
    Thanks,
    Amit

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Unicode String Issue while Using Results from Another Query

    Hi All,
    In a webi report i have 2 queries say Sales Out and Investment. I need to have only those chains which are in Investement in Sales Out.
    So in Sales Out query i am using the option Results from another Query. The Chain values are in Unicode format.
    Though in universe i have Set Parameter Unicode_String ='Yes', this does not get applied when using option Results from another Query.
    Is there any solution to resolve this problem.
    Thanks
    Madhura

    leonhardtk wrote:
    I need to take values from the column of one table that meets certain critera, and create inserts into another table that includes this data.
    For example...
    {code}
    select emp_last_name from emp where emp_first_name like 'B%';
    Duncan
    Fitzgerald
    Johnson
    Smith
    {code}
    I then want to insert these values into another table:
    {code}
    insert into My_table values (
    sequence.nextval,99,99,[last_name]);
    {code}
    In the example above, I need it to insert a new row into My_table for where the "last_name" is each of the names from the select statement above (Duncan, Fitzgerald,Johnson,Smith).
    Based on other similar forum questions it looks like I should be doing something like:
    {code}
    INSERT INTO MY_TABLE
    (SELECT sequence.nextval,
                    99,
                    99,
                   (select EMP_LAST_NAME
                    FROM EMP
                    WHERE EMP_FIRST_NAME LIKE 'B%')
    {code}
    But this (obviously) doesn't work!
    Appreciate any assistance on this!
    KSL.
    Hi,
    Created this test data
    create table plch_test (name varchar2(50));
    insert into plch_test values('AKSHAY');
    insert into plch_test values('RAHUL');
    insert into plch_test values('APARNA');
    output
    1    AKSHAY
    2    RAHUL
    3    APARNA
    created another destnation table(in your case "my table")
    create table plch_test_1 (id number,name varchar2(50));
    created another sequence to generate employee ids
    create sequence test_seq;
    Now populated the desination table
    insert into plch_test_1(select test_seq.nextval,name from plch_test);
    verify the destination table
    select * from plch_test_1
    1    AKSHAY
    2    RAHUL
    3    APARNA
    Hope this helps
    Regards,
    Achyut Kotekal

Maybe you are looking for