public Term selectTerm ( final long id ) throws SQLException { Connection conn = null ; PreparedStatement stmt = null ; ResultSet rs = null ; Timer . Context ctx = metrics . selectTermTimer . time ( ) ; try { conn = connectionSupplier . getConnection ( ) ; stmt = conn . prepareStatement ( selectTermIdSQL ) ; stmt . setLong ( 1 , id ) ; rs = stmt . executeQuery ( ) ; return rs . next ( ) ? new Term ( id , rs . getString ( 1 ) , rs . getString ( 2 ) ) : null ; } finally { ctx . stop ( ) ; closeQuietly ( conn , stmt , rs ) ; } }
Selects a term by id .