Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Wild card or regular expression

Thread view: 
sconeek@gmail.com - 10 Mar 2006 05:21 GMT
hi all,
i am trying to implement a functionality where the code searches for
anything, which matches a certain pattern. i have created the following
but am unable to zero in how to do it.

i have the following sentence,
fetchItemMain(this.aType().xxxx);

now i need to match which matches anything aType.whatever. now xxxx can
be anything.

can somebody suggest on how to go about it.

thanks
Hendrik Maryns - 10 Mar 2006 12:30 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

sconeek@gmail.com schreef:
> hi all,
> i am trying to implement a functionality where the code searches for
[quoted text clipped - 8 lines]
>
> can somebody suggest on how to go about it.

Not if you give no more elaborate, less cryptic explanation.

What do you want?  What did you try?  What do you /really/ want?

H.
Signature

Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org

sconeek@gmail.com - 10 Mar 2006 12:57 GMT
I am performing a search within the DB. now i do not want to hardcode
the string, or use a linked list. i want to just say
fetchItemMain(this.aType()-------)

now i am not sure what goes in place of ------. so all i am saying is
give me all results which start with aType. but how should i do it
programmatically?

i hope this clarifies it.
Jan Thomä - 10 Mar 2006 13:33 GMT
> I am performing a search within the DB. now i do not want to hardcode
> the string, or use a linked list. i want to just say
[quoted text clipped - 5 lines]
>
> i hope this clarifies it.

Hi,

actually not really. What do you mean by DB? Are you talking about SQL
statements here? Can you maybe provide a bigger code snippet so we can
get an idea what do you want to achieve?

Best regards,
Jan
Hendrik Maryns - 10 Mar 2006 14:04 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

sconeek@gmail.com schreef:
> I am performing a search within the DB. now i do not want to hardcode
> the string, or use a linked list. i want to just say
[quoted text clipped - 5 lines]
>
> i hope this clarifies it.

It doesn?t.  See http://www.catb.org/~esr/faqs/smart-questions.html

Also interesting: http://mindprod.com/jgloss/newsgroups.html

H.

Signature

Hendrik Maryns

==================
www.lieverleven.be
http://aouw.org

tom fredriksen - 12 Mar 2006 17:40 GMT
> I am performing a search within the DB. now i do not want to hardcode
> the string, or use a linked list. i want to just say
[quoted text clipped - 3 lines]
> give me all results which start with aType. but how should i do it
> programmatically?

First lets try to understand what you want to do.

Normally I would interpret what you are saying as a mechanism to specify
with a sort of "pattern match" object with pattern values what you are
looking for, e.g.

    getFromStorage( new anEmployee(name="?", salary>50000) )

Is this what you are thinking?

/tom
sconeek@gmail.com - 13 Mar 2006 00:28 GMT
ok. i hope this really clarfies it.
i have a postgres DB. my java code accesses this db. this table
contains a lot of records with field names. now i am trying to filter
data from within this table.
eg field name, name-lastname (mr-smith)
now i have a selected number of names, eg. mr,mrs,miss. so i have
specified these entries within a linkedlist.
so my current implementation is, fetchItemMain(linkedlist + "-" +
something);
but i want to replace linkedlist with "anything which starts with m".
so instead of running a loop x times based on the number of items
within my linkedlist, i want to say return anything which starts with
m.
i hope this helps. thanks.
tom fredriksen - 14 Mar 2006 09:53 GMT
> ok. i hope this really clarfies it.
> i have a postgres DB. my java code accesses this db. this table
[quoted text clipped - 9 lines]
> within my linkedlist, i want to say return anything which starts with
> m.

Whats the problem? Postgres has support for regexp text searches, look
it up in online db documents. In any case, you need to construct the sql
statement with the correct regexp in your application, how you do that
is up to you. A linked list is as good as any for such a purpose, unless
you are able to somehow automagically detect what you need without
writing any code for it.

/tom


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.