public PreparedStatement getPreparedUpdate ( String tableName , Update update ) { synchronized ( m_prepUpdateMap ) { Map < Update , PreparedStatement > statementMap = m_prepUpdateMap . get ( tableName ) ; if ( statementMap == null ) { statementMap = new HashMap <> ( ) ; m_prepUpdateMap . put ( tableName , statementMap ) ; } PreparedStatement prepState = statementMap . get ( update ) ; if ( prepState == null ) { prepState = prepareUpdate ( tableName , update ) ; statementMap . put ( update , prepState ) ; } return prepState ; } }
Get the given prepared statement for the given table and update . Upon first invocation for a given combo the query is parsed and cached .