1. Using a variable instead of a parameter index with a JDBC prepared statement stackoverflow.comIn many programming languages something like this is possible for prepared statements:
But not with java.sql.PreparedStatement. In ... |
2. Prepared statement - static variable coderanch.comI think what you are looking for is caching of prepared statements. Some connection pools do that for you as an optional tuning parameter (Weblogic, I think JBoss too). Handy for situations where the same prepared statement will get used multiple times in a runtime session, not necessarily even in the same transaction. Your use of a static basically means you ... |
3. PreparedStatement with dynamic variable? coderanch.com |