File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes output parameter returned by the stored procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "output parameter returned by the stored procedure" Watch "output parameter returned by the stored procedure" New topic
Author

output parameter returned by the stored procedure

Armin Lus
Greenhorn

Joined: Dec 27, 2002
Posts: 4
Hello,
Which statement you think is better to use from the performance perspective?
stmt.registerOutParameter(1, java.sql.Types.INTEGER);
OR
stmt.registerOutParameter(1, OracleTypes.CURSOR);

What are any ( )possible ways to improve performance ( Java and Oracle 8i).
Thanks,
Armin
Ratan Dhariwal
Greenhorn

Joined: Aug 01, 2001
Posts: 3
I do not have answer to above question directly. as I am not using Oracle
But i recommed you to prefer 1st approach as the code is more portable.
I don't think there will be a lot of performance issue between the statements you mentioned.

But there are few ways you can improve performance
1. Use connection pooling,
2. If a statement is used more than once, prefer using Prepared statements.
3. Optimize your sql statements carefully before placing in your code.
4. Do not keep holding your connections, release them as soon as you are done.
5. Retrive the columns/Data you need from SQL, that will save network traffic
6. Cache the data that is used more often and does not change a lot
These are few direct tips
Hope they help
Ratan...
Armin Lus
Greenhorn

Joined: Dec 27, 2002
Posts: 4
Thanks Ratan...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: output parameter returned by the stored procedure