• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1730
  • Last Modified:

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
0
M_SYED
Asked:
M_SYED
  • 3
  • 2
1 Solution
 
xberryCommented:
As a kinda "first aid" ; )) I found this reference:

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

Best Regards
0
 
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 ; ))
0
 
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
0
 
xberryCommented:
I'm glad you solved it
and thanks for honouring
response as such ; ))
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now