Java Urgent Question   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkTechnology - Talk Only Tech � Java Urgent Question Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of pageLink to this message

Bob
Yavvanam Kaatesina Bewarse
Username: Bob

Post Number: 2010
Registered: 03-2005
Posted From: 220.240.44.49

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 10:57 pm:Edit PostDelete PostView Post/Check IP

Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9589
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:45 pm:Edit PostDelete PostView Post/Check IP

Thanks Mama But I have to see wether this way can be used or not as I told u There are lots of servlets and JSP's where parameters are being passed.
However I will try like this and see to change the code everywhere to this method
Thanks
Top of pagePrevious messageNext messageBottom of pageLink to this message

Proofdada
Bewarse Legend
Username: Proofdada

Post Number: 28218
Registered: 03-2004
Posted From: 195.3.113.150

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:42 pm:Edit PostDelete PostView Post/Check IP

sinnna ga chala simple ayyi vuntadi java loo ..try cheesi choodu....
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9588
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:42 pm:Edit PostDelete PostView Post/Check IP

Sree annayyi unte vachi helping ceyyyi
Top of pagePrevious messageNext messageBottom of pageLink to this message

Eeidlagolayenti
Kurra Bewarse
Username: Eeidlagolayenti

Post Number: 769
Registered: 03-2005
Posted From: 66.121.23.130

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:42 pm:Edit PostDelete PostView Post/Check IP

e.g code

String sql = null;
String s = new String ("'Air Compressors' 'pens' 'car services'");
StringTokenizer stk = new StringTokenizer(s,"'");
while(stk.hasMoreTokens())
{
String token = stk.nextToken();
StringTokenizer stk2 = new StringTokenizer(token," ");
if ( sql != null )
{
sql = sql + "AND";
}
while(stk2.hasMoreTokens())
{
String token2 = stk.nextToken();
if ( sql == null )
{
sql = token2;
}
else
{
sql = sql + "OR" + token2;
}
}


}
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9587
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:40 pm:Edit PostDelete PostView Post/Check IP

But Finally all should be stored in a single variable itself...
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9586
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:39 pm:Edit PostDelete PostView Post/Check IP

Ante like etla ante Air and Compressors ni oka chote store cheyyatamu
taruvatha pens ni inko chota
atla emaina unda easy ga?
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9585
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:38 pm:Edit PostDelete PostView Post/Check IP

Ya aunu mama using that st.nextToken() I am able to get each word seperately But those have to be stored in some varible because that variable has to passed from servlet to other servlet a lot of time using getParameter() so the problem is how to store mama...
Top of pagePrevious messageNext messageBottom of pageLink to this message

Eeidlagolayenti
Kurra Bewarse
Username: Eeidlagolayenti

Post Number: 768
Registered: 03-2005
Posted From: 66.121.23.130

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:37 pm:Edit PostDelete PostView Post/Check IP

StringTokenizer ani vuntundi..

using that you can get different tokens, which you can use to parse and create sql.
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9584
Registered: 04-2005
Posted From: 68.226.157.141

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:32 pm:Edit PostDelete PostView Post/Check IP

Java lone kavali Servlet lo rayataniki
Naku adi break chesi endulo store chesukunte Search Query rasethappudu easy ga untado cheppandi please...
Top of pagePrevious messageNext messageBottom of pageLink to this message

Proofdada
Bewarse Legend
Username: Proofdada

Post Number: 28216
Registered: 03-2004
Posted From: 195.3.113.146

Rating:N/A
Votes: 0(Vote!)

Posted on Monday, September 12, 2005 - 4:30 pm:Edit PostDelete PostView Post/Check IP

c++ loo aithe format loo/concat thoo solve cheyochu...java lo theldu...
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinna
Celebrity Bewarse
Username: Sinna

Post Number: 9583
Registered: 04-2005
Posted From: 68.226.157.141

Rating:
Votes: 2(Vote!)

Posted on Monday, September 12, 2005 - 4:27 pm:Edit PostDelete PostView Post/Check IP

Naku okka pedda problem vachi padindi

Now Oka keyword that is entered by user to search undi anukondi

For Ex 'Air Compressors' 'pens' 'car services'

Idantha first oka string lo store chesukuni taruvatha parsing evevo chesi then Sql Query thoni database lo nunchi results testhunnanu
Kani ikkad aOR Query vaduthunna for searching
Like Air OR Compressors OR Pens OR Car OR Services

I want the searh to be

Air AND Compressors OR Pens OR CAR AND SERVICES

Deeni kosamani nenu anukundi when parsing the string in a java servlet code using the Single Quote I can differentiate and find out wether AND should be applied or OR should be
So I just wanted to know How to store the Broken KeyWords and what is to be used to store in java that is either HashTable or Vector or any other
I am not able to understand how to store them so as to write databse queries
Please help me immediately