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?
Well, maybe this one does give you some idea:


Else, I hope that some "cutting edge" - expert will turn up for you soon ; ))
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
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 ; ))
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.