public int compile ( ) throws SQLException { int count = 0 ; for ( Map . Entry < String , ParametricStatement > entry : _statements . entrySet ( ) ) { try { ParametricStatement statement = entry . getValue ( ) ; Connection connection = DataSourceUtils . getConnection ( _dataSource ) ; if ( statement instanceof ParametricQuery ) { connection . prepareStatement ( statement . getSQL ( ) ) ; } else { try { connection . prepareCall ( statement . getSQL ( ) ) ; } catch ( Exception x ) { connection . prepareStatement ( statement . getSQL ( ) ) ; } } ++ count ; } catch ( SQLException x ) { throw new SQLException ( entry . getKey ( ) , x ) ; } } return count ; }
Compile all ParametricStatement registered with this Persistence .