Db link Query in Java

I 'm executing a sql query from Java. The sql has data from two different database and i'm using db link for the same.
But my java program connects to only one database. So my program is throwing "connection description ofrm remote database not found" error.
How can i change my java program which will solve this issue?

GaneshJay wrote:
I 'm executing a sql query from Java. The sql has data from two different database and i'm using db link for the same.
But my java program connects to only one database. So my program is throwing "connection description ofrm remote database not found" error.
How can i change my java program which will solve this issue?Doesn't sound like an application error, it's probably a database error. What happens if you execute the query in the database through a tool? (Query browser?)

Similar Messages

  • BEx Query from Java

    Hi
    Can I call a BEx Query from Java . If yes, in what format data will be returned? We just need data, we want to structure it in Java for display in a Flex UI.
    Please note that I have very limited knowledge of both Java and BI.
    Thanks in advance for your help.
    Best Regards
    Saurabh

    Hi,
    Yes you can. It will be contained in a web template.
    Please read through the link below and the related links contained within.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
    Thanks,
    Michael
    Edited by: Michael Devine on May 25, 2010 3:40 PM

  • Create DB Link dynamically in JAVA - Problems

    Hi everyone,
    I am trying to dynamically create a database link in the database. Now what I am asking is this. When I type in SQLPlus create database link 123... and execute it, the database link is created just fine.
    BUT when I pass the exact same statement through a java class (ie stm.execute("create database link 123...");) I get errors....
    Does anyone have any idea why this occurs?
    Thank you all.
    Koz Paz

    GaneshJay wrote:
    I 'm executing a sql query from Java. The sql has data from two different database and i'm using db link for the same.
    But my java program connects to only one database. So my program is throwing "connection description ofrm remote database not found" error.
    How can i change my java program which will solve this issue?Doesn't sound like an application error, it's probably a database error. What happens if you execute the query in the database through a tool? (Query browser?)

  • How to generate all the links of the java api methods

    Hi all,
    I noticed from my docs that the JAVA API methods are not linked. They are just static text. How can i link all the java api methods to a root url examble: java.sun.com/j2se/docs/javax/JFrame#pack()
    java.sun.com/j2se/docs/javax/JFrame#setVisible()
    java.sun.com/j2se/docs/java/sql/ResultSet#executeQuery()
    and so on.
    Thank you in advance.

    It sounds like you'd like to link to our docs on java.sun.com.
    You can do this using -link or -linkoffline
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/javadoc.html#link
    Start by reading the section "Choosing between -linkoffline and -link"
    Basically, try this option first:
    -link http://java.sun.com/j2se/1.4/docs/api
    If this fails (because your shell cannot access java.sun.com),
    then copy package-list from java.sun.com to your current directory,
    then use this option:
    -linkoffline http://java.sun.com/j2se/1.4/docs/api .
    Notice that the second argument is a dot "." to indicate
    that package-list is in the current directory.
    -Doug Kramer
    Javadoc team

  • How to use sql query in java ?

    i don't know how to use sql query in java code.
    who can give me some advice?
    thanks

    http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • Error occurred while sending query result: 'java.lang.NullPointerException'

    I am doing end to end scenario from SQL server to File
    JDBC --XI -- File
    I am getting the following Error while monitoring the sender CC in RWB
    "Error occurred while sending query result: 'java.lang.NullPointerException'
    Please Help !!

    Hi,
    To see the Adapter Error log, try:
    http://<XiServerHostName>:<J2EE-Port>/MessagingSystem
    Try viewing the Audit Log for each message (Newspaper Icon)
    Regards,
    Amitabha

  • Problem while querying from java

    I have a query like this ...
    Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='09/19/2004';
    I want to execute the same query using java for which i say
    String QQQ="Select name,description,start_date from Events where TO_CHAR(start_date,'MM/DD/YYYY')='?/?/?'"
    PreparedStatement stmt = conn.prepareStatement(QQQ);
    stmt.setString(1,"09");
    stmt.setString(2,"27");
    stmt.setString(3,"2004");
    But I am not getting the results. Is there anything wrong with the Qusetion marks(?) in the query ?
    I get the results if i directly enter the value for the question mark.
    Please help.
    Thanks.

    Date date = get a Date object somehow, perhaps from SimpleDateFormat.parse()
    String query = "Select name,description,start_date from Events where start_date = ?";
    PreparedStatement ps = con.prepareStatement(query);
    ps.setDate(1, date);
    ps.executeQuery();

  • Binding parameter to SQL/xpath query using java/jdbc

    I'm trying to execute a query containing an xpath.
    The query looks like this:
    select * FROM table  t where t.column.existsNode('/RootElement[contains(SubElement, "someVal")]/SubElement')In java replacing the "someVal" with a bind parameter "?" will not work:
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, ? )]/SubElement') = 1");
    ps.setString(1,"someVal");
    =EXCEPTIONOn this forum I found that you can also use '||:namedParam||'
    So the query in java would be executed like;
    PreparedStatement ps = c.prepareStatement("select * FROM table t where t.column.existsNode('/RootElement[contains(SubElement, '||:1||' )]/SubElement') = 1");
    ps.setString(1,"someVal");This seems to work (I have no idea what the '|| ||' construct does, I don't seem to find any info about it)
    HOWEVER, it seems that doing it this way the value being bound is NOT escaped.
    So, doing this will yield in an orcale SQL/xpath exception:
    ps.setString(1,"som'eVal");
    I've went to all the oracle xml manual stuff I could find, but nowhere do they address this.
    Any one an idea how I can bind the value and still have escaping ?
    Edited by: user5893566 on Nov 27, 2008 12:06 AM
    Edited by: user5893566 on Nov 27, 2008 12:15 AM

    Would you mind explain me what the replace actually does?The idea is like this:
    Let's start with a string like some'V"al and surround it by the concat function:
      '...concat("' || some'V"al || '") ....' {code}
    replace the inner (i.e. all) double quotes with +",''","+ to obtain '...concat("' || some'V",''"'',"al || '") ...' {code}
    So this concatenates three parts of the original string where the double quotes are now enclosed by two single quotes. The resulting string should look like
    {code} '...concat("some'V",''"'',"al") ...'i.e. first argument of concat is enclosed by double quotes, the second one by two single quotes and the third one again by double quotes.  This is just a rewritten form of our original string!.
    Now incorporate the whole thing in the xpath expression  as shown in my previous example and it should work ;)
    hth
    michael                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Html and email link in a java application

    Hi all
    How do you put a email or HTML link into a Java application.
    I want to put my web site address and email address into a about dialog.
    I would like to be able to open the default email application and web site from this dialog box.
    Thanks to all
    Craig

    Try just making a label, and formatting it to look like a generic link. Then add a listener that performs the desired action when you click on it. The "desired action" would probably involve starting the user's default browser/mail-program and loading something in it. I have no idea how to do that, but the above should at least get you a "link" that responds when you click it, and that's a start.

  • How i can execute the sql query in java code

    I already have sql query in jave plateform i need to execute this code how i can do that. i have unix env and with oracle database. should i just run this query in my sqlplus. this file has extention .java. thanks

    you can create a project in JDeveloper add the java file to it, add the Oracle JDBC library to the project properties and then hit the run button.

  • Link Query and Ref Cursor Query

    Hi all!!
    How can I link Query and Ref Cursor Query??
    I mean, How can I pass input parameters to the PL/SQL procedure if they are not User parameters but they come from another table??
    Thanks a lot
    F.

    I have searched the forum and this is the closest to my problem.
    Just started using ref cursors in my reports.
    The problem I am running into is that I have two ref cursor queries in my report - they each contain a column named seq_no which forms a join (in the database) .
    My report returns the correct number of records in each query, but I can't find a way to enforce the join. I've tried all the methods I can think of including combining the results into one query.
    The IDE won't let me join on a column and when I join on the group (which I make only contain the seq_no fields) that join is ignored.
    Can anyone help me on this?

  • SQL Fails when a division is included in query (in Java Code)

    Not sure this is the correct Forum to as this:
    Running Oracle 10g R2 on XP/Vista
    I have a query that contains a division operation (y.value as x.value/z.value) runs in SQLPlus and The NetBeans 6.5.1 Query Editor OK but when I insert it into Java (1.6) code (abc.java) it fails.
    I tried to escape the "\" operator <whatever> (\/) and that dows not work either.
    Can someone help me with this
    Thanks
    J.

    Thanks ... You got me on that one... should havr provided the query upfront..
    However, I thought it was more likely that there was something one always has to do to get "functions" to run inside a query inside Java code
    Here's the query plus some code
    Pls note the: round(((x.VALUE/226672)*100),2) as Percentage
    r_dayEBOMDataProvider.setCachedRowSet((javax.sql.rowset.CachedRowSet) getValue("#{Page1.r_dayEBOMRowSet}"));
    r_dayEBOMRowSet.setDataSourceName("java:comp/env/jdbc/ABC_Oracle");
    r_dayEBOMRowSet.setCommand("WITH vals AS (SELECT date_day, value, site_datatype_id FROM r_day WHERE site_datatype_id = '1234' AND date_day > date_day - 367) SELECT x.date_day,x.VALUE,y.date_day,y.VALUE AS valuem1w,z.date_day,z.VALUE AS valuem1y,round(((x.VALUE/226672)*100),2) as Percentage FROM vals x, vals y, vals z WHERE y.date_day(+) = x.date_day - 7 AND z.date_day(+) = ADD_MONTHS (x.date_day,-12) AND y.site_datatype_id(+) = x.site_datatype_id AND z.site_datatype_id(+) = x.site_datatype_id AND x.date_day = TO_DATE('16-Feb-2010','DD-MON-YYYY')");
    r_dayEBOMRowSet.setTableName("R_DAY");
    Again, this works fine inside of SqlPlus and NetBeans Query Editor
    not in Java code thought.
    Thanks
    J.

  • Search in Double link list in java

    Can any body give me the code implementation for searching an element in double link list in java as soon as possible...

    Can any body give me the code implementation for
    searching an element in double link list in java as
    soon as possible...Psuedo code...
    current = head of list
    found = null
    while(current is not null)
       if doesItMatch(current, target)
            break
       current = current->next
    if (current is null)  Out("no match")
    else Out("found it")

  • How changing the criterion for an access query in java?

    Hi @ all
    I would like to change a criterion for an access-query in java. I know how to run a access-query in java. How can I change the criterion in my access query in java without running the query it selfs? Can anybody help me?
    Thx
    Dario

    I would like to change a criterion for an
    access-query in java. I know how to run a
    access-query in java. How can I change the criterion
    in my access query in java without running the query
    it selfs? Can anybody help me?
    You can't.
    The database processes the query and then returns the result to you. Thus to change the query you must run the query again.
    You can of course add code do do the same thing. But unless it is very simple it is going to take a lot of code and might even be slower than doing the database call.

  • Doubly Link List in Java

    How can we write the program for Doubly Link List in java?
    Please give program with detailed explanation.

    You may want to post this on Java forums at:
    http://forum.java.sun.com/forum.jspa?forumID=24
    http://forum.java.sun.com/index.jspa
    I found the following threads that may be of use:
    http://forum.java.sun.com/thread.jspa?forumID=256&threadID=196730
    http://forum.java.sun.com/thread.jspa?forumID=24&threadID=619245
    Also: an example at http://www.sourcecodesworld.com/articles/java/java-data-structures/Doubly_Linked_Lists_with_Enumeration.asp

Maybe you are looking for

  • How to use double click trigger in ListBoxItem template?

    Hi all, I want to double click listBoxItem in listbox, and set this item as editable status. It says make textbox as visible, please see the below code. When press Enter key or lost focus, then make textbox as invisible and textblock as visible. It's

  • Programming Web Item. Problem with URL creating

    Hi, I am trying to programm a own Web Item. I derived from the class CL_RSR_WWW_ITEM_VIEW. Everything is worken fine. I just have a problem with the creation of links. In the WAD there is the very nice way of using SAP BW URLs like: <SAP_BW_URL cmd="

  • Oracle View export/import copy

    good morning all, i have a vpn connection to an oracle database am connecting via oracle client 10g OS is windows.. now i have view with 12 fields now when i query the view the results comes in 12 seperate lines.. field1 field2 field field field fiel

  • Tabulation and arrow keys don�t work through ssh

    Hi! I just got a solaris 10 on a v240. But I loggin through SSH, tabulation key and arroy keys don� t work. It � s quite nasty because I cannot just repeat a command for example, I�ve to type it allover again. I� m quite surprised because I have an o

  • Run Time exception while installing SOA Suite 11g

    Hi A,,. I am trying to install soa suite 11g. I ahve installed oracle universe xprress edistion database, weblogic server,rcu (repository) successfully and now I tried installing soa suite 11g. It passed all the pre requisits and when i click on inst