ORA 02019 connection description for remote database not found

Posted on 2006-04-11
Last Modified: 2012-08-14
Hi All,

I have a simple program trying to connect to a database through weblogic.

This is the piece of code.

javax.naming.Context initialContext = new javax.naming.InitialContext();
            // get the datasource connection
            DataSource ds = (DataSource)initialContext.lookup("RoCDS");

      Connection con = ds.getConnection();
      //Connection c = getConnection();
      System.out.println("After getting connection");
      int count = 0;
            Statement s = con.createStatement();
                  String q = "SELECT count(*)"
                  + " FROM party WHERE user_name = " + email;
                  ResultSet rs = s.executeQuery(q);
                        while (
                              count = rs.getInt(1);
                        return count;
                  } finally { rs.close(); }
            } finally { s.close(); }
      } finally { con.close(); }
      catch (SQLException e)
            throw new DataAccessException(e);

When I try to run the program I get the following error.
ORA 02019 connection description for remote database not found.

My config.xml is:

        MaxCapacity="50" Name="RoC connection pool"
        Properties="user=roc_user" Targets="myserver"
        TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@"/>
    <JDBCTxDataSource EnableTwoPhaseCommit="false" JNDIName="RoCDS"
        Name="RoCDS" PoolName="RoC connection pool" Targets="myserver"/>

Please let me know.
Looking forward to your comments.

Best Regards
Question by:M_SYED
    LVL 14

    Expert Comment

    As a kinda "first aid" ; )) I found this reference:

    Author Comment

    Thanks for the reply.
    I had already visited the posted link though.

    Best Regards
    LVL 14

    Accepted Solution

    Well, maybe this one does give you some idea:

    Else, I hope that some "cutting edge" - expert will turn up for you soon ; ))

    Author Comment

    I have solved the problem.
    I have used PreparedStatement instead of Statement and it worked.

    Thanks a lot for your comments.

    xberry: I am gona give u the point for responding.......... :-)

    Take Care
    LVL 14

    Expert Comment

    I'm glad you solved it
    and thanks for honouring
    response as such ; ))

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now