WrappedStatement compile ( String sql ) throws SQLException { WrappedStatement ws ; if ( ! isEnabled ( Option . REUSE_STATEMENTS ) ) { ws = new WrappedStatement ( connection . prepareStatement ( sql ) , false ) ; } else { if ( pool == null ) { pool = new IdentityHashMap <> ( ) ; } String sqlI = sql . intern ( ) ; ws = pool . get ( sqlI ) ; if ( ws == null ) { ws = new WrappedStatement ( connection . prepareStatement ( sql ) , true ) ; pool . put ( sqlI , ws ) ; } } return ws ; }
Compile a SQL statement .