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;
      try
      {
            Statement s = con.createStatement();
            try
            {
                  String q = "SELECT count(*)"
                  + " FROM party WHERE user_name = " + email;
                  ResultSet rs = s.executeQuery(q);
                           try
                  {
                        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:

<JDBCConnectionPool
        DriverName="oracle.jdbc.xa.client.OracleXADataSource"
        MaxCapacity="50" Name="RoC connection pool"
        PasswordEncrypted="{3DES}zAV5C3efu8IEymlct4toQw=="
        Properties="user=roc_user" Targets="myserver"
        TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:oracle:thin:@192.168.1.38:1521:roc"/>
    <JDBCTxDataSource EnableTwoPhaseCommit="false" JNDIName="RoCDS"
        Name="RoCDS" PoolName="RoC connection pool" Targets="myserver"/>

Please let me know.
Looking forward to your comments.

Best Regards
M_SYEDAsked:
Who is Participating?

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

x
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.

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

http://ora-02019.ora-code.com/
M_SYEDAuthor Commented:
Thanks for the reply.
I had already visited the posted link though.

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

http://www.experts-exchange.com/Databases/Oracle/Q_20174416.html

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
xberryCommented:
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
Java

From novice to tech pro — start learning today.