By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,947 Members | 515 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,947 IT Pros & Developers. It's quick & easy.

Can Java Store Procedure increase performance?

P: 2
Performance reason we need to move some of our code into database. Java Store Procedure is given the first choice. However, while investigating some sample code of Java store procedure, PreparedStatement seems to be a must, such as PreparedStatement pstmt = conn.prepareStatement(sql); ..., pstmt.close() in the end.

My question is that if the prepareStatement(sql) is called each time when the Java Store Procedure is called, will the prepareStatement() lose it's original meaning of compiled once and running many times to increase performance? If the prepareStatement(sql) is not going to be called each time, will pstmt.close() actually does anything?

In other words, is Java Store Procedure designed to work as PL/SQL stored procedure inside database? Or it is just a way to running Java inside database? If Java Store Procedure can really provide some performance by running inside database, do we have some sample code that does not contradict to general common sense?

Thanks in advance for your time and help you may provide. My apology that I had posted the same message in Java Forum because I am not sure Java glue or Oracle expert knows the answer.

Sep 14 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.