Can Java Store Procedure increase performance
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, can Java Store Procedure really provide some performance by running inside database? If so, is there some sample code that does not contradict to general common sense?
Thanks in advance for your time and help you may provide.
rding