ok thanks.
But I am curious you use OracleCallableStatement
Is their away that you can just use the CallableStatement object in the standard
JDBC class.
Because using oracles function is not as portable i.e ... oracle.jdbc.OracleTypes.CURSOR
When I try to use registerOutParameter from a CallableStatement statement I don't know what the parameter in place of oracle.jdbc.OracleTypes.CURSOR should be?
Question 2
I can from a JDBC Connection use a statement , preparedStatement , or CallableStatement.
Correct me if I am wrong.
But the statement cann't have ? in it .. It must be a Hardcoded SQL statement (fix).
PreparedStatements extend the statement and provide a way to dynamically customize the query
string using ? ? ? ...etc
They say it is precompiled.
CallableStatement is what I am alittle confused about it extends PreparedStatement but it is used to call a stored procedure on the database.
What is the benifits of using this over just setAutoCommit(false) for the connection and then use a whole bunch of preparedStatements with java if statement (for the equivalent logic of pl/sql) then commit it or rollback. Wouldn't it have the same amount of functionality and work the same way as just creating a stored procedure on the database and calling it with a CallableStatement?
Even if the stored procedure is huge and contains
alot of DDL and DML statements I would think you could do the equivalent with a ton of preparedstatements. Is their some kind of performance/memory space benfit to using one over the other?
Or is this just a matter of preference. Because I would imaging the difference is weather you want to write the code in PL/SQL call it thru java or just write it in java using SQL query's.
Seems cleaner (provided you know pl/sql) to compile the stored procedurce on the database it self and just call the procedure using callable statements thru java. Plus if you do it this way you are running the queries at the database level and not thru the java code if their is a benifit to that in any way? (maybe speed???)
Thanks for any info
Is their somewhere I can get a good tutorial on pl/sql and stored procedures ... i.e a list of all the possible key words and how to use them (hyperlink please)