Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> java stored procedure - how do I connect?

java stored procedure - how do I connect?

From: Don Chambers <dchamber_at_mindspring.com>
Date: 13 Sep 2001 20:27:12 -0500
Message-ID: <v2m2qts0q5n3rcn142ph1ufuueff5ubr4c@4ax.com>


I am trying to implement Oracle stored procedures using java and I am having some trouble with the connection. These are complicated procedures that use many methods of different classes. I would also like these classes to be able to run outside of oracle if needed.

I hava a connect class that gets a database connection and closes it. The version of this class that I deploy to Oracle gets the default connection and the close operation is disabled.

Many of my methods must connect to the database, do their work, and close the connection. Everything works fine outside of Oracle but when I deploy to Oracle and execute the procedure I get an error that too many cursors are open. If I actually call the close method of the connection object I seem to loose all instances of my connection. The docuemntation says the close() emthod does nothing.

I think this is because I create a lot of conenctions but I am using the default connection so it should only be 1 connection. Can anyone help me with this?
Do you have any suggestions?

Below is a sample of the tryp things I must do:

Class LoadTable



connect
  get all items to load
  loop

     call InsertClass.load with item
  end loop
close connection (if not in oracle)



Class InsertClass

load method

   connect

      call getID
      insert the record

   close conenction (if not in oracle)    

getID method
  connect
    get the id from sequence
  close conenction (if not in oracle)
  return id

Thanks for any help,

   Don Received on Thu Sep 13 2001 - 20:27:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US