public List<String> getIdentifiers(String propertyId, boolean ownOnly) throws VCASException
   {
      try
      {
         Connection con = dataSource.getConnection();
         PreparedStatement ps = null;
         ResultSet rs = null;
         try
         {
            List<String> ids = new ArrayList<String>();

            if (ownOnly)
            {
               ps = con.prepareStatement(sqlSelectOwnRecords);
               ps.setString(1, propertyId);
               rs = ps.executeQuery();
               if (rs.next())
               {
                  do
                  {
                     rs.getString("SHARED_ID");
                     if (rs.wasNull())
                        ids.add(rs.getString("CAS_ID"));
                  }
                  while (rs.next());
                  return ids;
               }
               else
               {
                  throw new RecordNotFoundException("No records found with propertyId=" + propertyId);
               }
            }
            else
            {
               ps = con.prepareStatement(sqlSelectRecords);
               ps.setString(1, propertyId);
               rs = ps.executeQuery();
               if (rs.next())
               {
                  do
                  {
                     ids.add(rs.getString("CAS_ID"));
                  }
                  while (rs.next());
                  return ids;
               }
               else
               {
                  throw new RecordNotFoundException("No records found with propertyId=" + propertyId);
               }
            }
         }
         finally
         {
            if (rs != null)
            {
               try
               {
                  rs.close();
               }
               catch (SQLException e)
               {
                  LOG.error("Can't close the ResultSet: " + e.getMessage());
               }
            }

            if (ps != null)
            {
               try
               {
                  ps.close();
               }
               catch (SQLException e)
               {
                  LOG.error("Can't close the Statement: " + e.getMessage());
               }
            }

            con.close();
         }
      }
      catch (SQLException e)
      {
         throw new VCASException("VCAS GET IDs database error: " + e, e);
      }
   }
public List < String > getIdentifiers ( String propertyId , boolean ownOnly ) throws VCASException { try { Connection con = dataSource . getConnection ( ) ; PreparedStatement ps = null ; ResultSet rs = null ; try { List < String > ids = new ArrayList < String > ( ) ; if ( ownOnly ) { ps = con . prepareStatement ( sqlSelectOwnRecords ) ; ps . setString ( 1 , propertyId ) ; rs = ps . executeQuery ( ) ; if ( rs . next ( ) ) { do { rs . getString ( "SHARED_ID" ) ; if ( rs . wasNull ( ) ) ids . add ( rs . getString ( "CAS_ID" ) ) ; } while ( rs . next ( ) ) ; return ids ; } else { throw new RecordNotFoundException ( "No records found with propertyId=" + propertyId ) ; } } else { ps = con . prepareStatement ( sqlSelectRecords ) ; ps . setString ( 1 , propertyId ) ; rs = ps . executeQuery ( ) ; if ( rs . next ( ) ) { do { ids . add ( rs . getString ( "CAS_ID" ) ) ; } while ( rs . next ( ) ) ; return ids ; } else { throw new RecordNotFoundException ( "No records found with propertyId=" + propertyId ) ; } } } finally { if ( rs != null ) { try { rs . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close the ResultSet: " + e . getMessage ( ) ) ; } } if ( ps != null ) { try { ps . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close the Statement: " + e . getMessage ( ) ) ; } } con . close ( ) ; } } catch ( SQLException e ) { throw new VCASException ( "VCAS GET IDs database error: " + e , e ) ; } }
{@inheritDoc}