java stored procedure - how do I connect?
Date: 13 Sep 2001 20:27:12 -0500
Message-ID: <v2m2qts0q5n3rcn142ph1ufuueff5ubr4c_at_4ax.com>
[Quoted] 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 Fri Sep 14 2001 - 03:27:12 CEST