Replies: 2 comments
-
Greetings. You can certainly cache Statements if you are in a situation when you would have to parse similar, but very complex statements many times. Although I have a hard time to construe such a situation. The more interesting challenge was to decide when a statement is equal. It would depend on a reliable hash of the SQL String -- after replacing any fixed Values (String, Boolean, Double, Long, Date) with parameters. Determining this hash would depend on parsing the statement -- defeating the purpose. Long story short: you can cache statements but I wonder why you would want to do that. Maybe you will need to elaborate on the exact challenge you want to overcome. Cheers. |
Beta Was this translation helpful? Give feedback.
-
I think the question is somewhat strange, since Statement is simply a more or less complex data container and does not do any computation on its own. Or are you asking about the toString approach? |
Beta Was this translation helpful? Give feedback.
-
Should I reusing Statement increases performance?
Beta Was this translation helpful? Give feedback.
All reactions