• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to check the existance of a record stored in a database

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
i have stored the cities' names in the database so that i can use these records in extracting cities from any given document.
what's the best way to do so?

1- The simplest way is to get each single record(city name) and check whether it exists in the document or not, but this will take a lot of time (looping through all the records, knowing that we have about 2000 city)

2- I thought of using regular expressions by placing all the cities in one regular expression like this (Anguilla|Vienna|Aberdeen|Boston|Egypt|Columbia....etc)
but as we said before it ll be too long regular expression that will take long time too

can anyone tell me what to do, what's the best solution in such cases
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This post has nothing to do with SCJP.

You might post it again at JDBC Forum.

Nick
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nadine ...

By the way, your name violates the Naming Policy, please change it at Your Profile.

Nick
 
You will always be treated with dignity. Now, strip naked, get on the probulator and hold this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic