ORA 02019 connection description for remote database not found

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 (rs.next())
                              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
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

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

Best Regards
Well, maybe this one does give you some idea:


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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
M_SYEDAuthor Commented:
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
I'm glad you solved it
and thanks for honouring
response as such ; ))
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.