@Override
    public void run() {
      // Open connection with database
      JdbcDaoSupport jdbcDao = new JdbcDaoSupport();
      jdbcDao.getConnection();
      // Search results
      this.lstTaxonOccurence = new ArrayList<TaxonOccurrence>();
      if (SearchTaxonActivity.this.taxonManager != null) {
        Log.i(
            getResources().getString(R.string.app_name),
            "Search by: " + SearchTaxonActivity.this.criteria);

        if (SearchTaxonActivity.this.criteria.equalsIgnoreCase("Code")) {
          Log.i(getResources().getString(R.string.app_name), "Search by Code");
          lstTaxonOccurence =
              SearchTaxonActivity.this.taxonManager.findByCode(
                  SearchTaxonActivity.this.taxonomy, strSearch, 1000);
        } else if (SearchTaxonActivity.this.criteria.equalsIgnoreCase("SciName")) {
          Log.i(getResources().getString(R.string.app_name), "Search by Scientific name");
          lstTaxonOccurence =
              SearchTaxonActivity.this.taxonManager.findByScientificName(
                  SearchTaxonActivity.this.taxonomy, strSearch, 1000);
        } else if (SearchTaxonActivity.this.criteria.equalsIgnoreCase("VernacularName")) {
          Log.i(getResources().getString(R.string.app_name), "Search by VernacularName");
          lstTaxonOccurence =
              SearchTaxonActivity.this.taxonManager.findByVernacularName(
                  SearchTaxonActivity.this.taxonomy, strSearch, 1000);

        } else {
          Log.i(
              getResources().getString(R.string.app_name),
              "Undefined criteria is: " + SearchTaxonActivity.this.criteria);
        }
      } else {
        Log.i(getResources().getString(R.string.app_name), "Species Manager is NULL!");
      }

      // Close connection
      JdbcDaoSupport.close();
      handler.sendEmptyMessage(0);
    }
예제 #2
0
 @Autowired
 public void initDataSource(DataSource dataSource) {
   super.setDataSource(dataSource);
 }
예제 #3
0
파일: StatisticsDao.java 프로젝트: rla/bcup
 @Override
 protected void initDao() throws Exception {
   super.initDao();
   log.debug("statistics dao created");
 }