public TaxonomyTerm selectTaxonomyTerm ( final String taxonomy , final String name ) throws SQLException { Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; long taxonomyTermId = 0L ; long termId = 0L ; String description = "" ; Timer . Context ctx = metrics . selectTaxonomyTermTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( selectTaxonomyTermSQL ) ; stmt . setString ( 1 , name ) ; stmt . setString ( 2 , taxonomy ) ; rs = stmt . executeQuery ( ) ; if ( rs . next ( ) ) { taxonomyTermId = rs . getLong ( 1 ) ; termId = rs . getLong ( 2 ) ; description = rs . getString ( 3 ) ; } else { return null ; } } finally { ctx . stop ( ) ; closeQuietly ( conn , stmt , rs ) ; } return new TaxonomyTerm ( taxonomyTermId , taxonomy , selectTerm ( termId ) , description ) ; }
Selects a taxonomy term .