• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

find method in B&S

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sun spec defines find method like this:

// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria)


number of field in each record has 6 elements
so criteria[] must have 6 elements ?
like this

criteria[0]=name
criteria[1]=location
criteria[2]=specialties
criteria[3]=size
criteria[4]=rate
criteria[5]=owner



since it is clearly written in spec "A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. "


My assumption for criteria array and find method okay ?
please reply .
 
pramod karnani
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Client side search

criteria[0]=name
criteria[1]=location
either criteria[2]= | or criteria[2]= &



Server side search

criteria[0]=name
criteria[1]=location
criteria[2]=specialties
criteria[3]=size
criteria[4]=rate
criteria[5]=owner


my assuption is okay for find method?
 
girl power ... turns out to be about a hundred watts. But they seriuosly don't like being connected to the grid. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic