Win a copy of Rust Web Development this week in the Other Languages forum!

aliya sharma

Ranch Hand
+ Follow
since Aug 11, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by aliya sharma

HI Jeanne,

Thanks for your response. How would i know which part query analyzer is taking too long to execute. I just see the total time when its done executing. I think its the last self join on the table itself where it's taking time(i ran it separetely and it took real long). BUt the self join is necessary because if you look at the statement, each partnumber has multiple keywords associated to it and the user has option of entering 2 keywords. So the self join returns the item number that has both keywords. It's the palph table i'm talking about.

Can you or anyone else please suggest some other way of achieving the same result but doesn't require selfjoining a table. I would be grateful. Thanks for your time , it's really appreciated

[ October 10, 2005: Message edited by: aliya sharma ]
[ October 10, 2005: Message edited by: aliya sharma ]
Thanks a lot Scott, it works fine now.

ALiya
17 years ago
I'm writing this simple program where StringTokenizer takes the string and gives me the result with seperator(which is , in my case). Heres the code:

but when i run my code, Im getting ballot04,expo as my output. I want to get ballot04
expo
I thought StringTokenizer removes/ignores the seperator and gives the result??. Is there something im doing wrong???. THanks for your help

Aliya
17 years ago
I managed to figured it out. Don't kow what i did differently though, but its working now. Code is same as mentioned before. I just ran it and its writing to the file. Now, on to, gettign information from database and writing to a file. I'll be back with more questions .

Aliya
17 years ago
the last catch should be:
17 years ago
Hello,
THis is a follow up from my previous post. I'm able to create a file but can't write to it. This is my code:

After i run this code, no exceptions are thrown and on my console its shows "output written". but when i open froogle.txt on C drive . there isn't anything in there. COuld someone please point me to the right path. I would realy appreciate it. I've been stuck on this for long time now. THanks.
Aliya
17 years ago
Hello David,
Its still giving me could not create file
The above is the code that i had in my catch method and which i had pasted as well.
Anywayz, i have figured out the problem. Thanks for your help , Jeff.

Aliya
17 years ago
So, how do i write to a file?. I tried this:

Its still giving me could not create file
17 years ago
Hello,
I'm a beginner in Java. I'm creating a file so i can write my query results to it. This is what i'm doing:

when i run this : it always give a "could not create file". Could anyone please tell me what im doing wrong. THanks for your help.
Aliya
17 years ago
Hey Shailesh,
i figured out the problem. Thanks a lot. And I really appreciate your help saritha.

Aliya
17 years ago
Hello Saritha and Shailesh,
Thanks a lot for your help. Saritha, i'm following your example. But when i try to execute my query, its giving me a type mismatch compiler error:
cannot convert from string to string buffer
this is my code:


Any ideas?. Again, i really appreciate your help.

Aliya
17 years ago
I forgot to mention, fruit is a column in the table food
17 years ago
Hello Saritha,
THanks for your response. i want to use the result of StringTokenizer in my SQL query in my java bean. let's say i have a table by the name of food, with fruit (with values APPLES, ORANGES,Bananas as its values). So, if the user enters in Apples, Oranges. My StringTOkenizer would seperate the values and send it to my bean(i do have set method in my bean). Now,In my bean, i want to use this query:

as you can see the parameters in IN part of the query could be more or less depending on the user's input. I'm really confused in how to achieve this. I would really appreciate any help or suggestions. Thanks a lot for your time and help

Aliya
17 years ago
Thanks for your response, Anupreet.
I was going to use StringTokenizer, but i don't know how to get the seperated value. For example:, lets say user enters Apples, oranges(it could be more). THis is what i know how to do in my controller servlet.

What do i do after that to get jst Apples oranges. I know how to print them.

but i need to pass these values from my servlet to the bean(number of values could vary)?

Aliya
17 years ago
how do i parse comma seperated values?. For example: if a user enters in
apple,orange in the single text field and submits the form, controller servlet should know 2 values are being sent from a text field so parse them and send them to the bean to query the database as: Select * from food where fruit in ('apple','orange').
Hope i made myself clear on the problem. Any ideas or relative code would be greatly appreciated. Thanks for your help.

Regards,
Aliya
17 years ago