Hello,
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.
rxding