Help coderanch get a
new server
by contributing to the fundraiser

Nawar Gailani

Ranch Hand
+ Follow
since Feb 08, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nawar Gailani

Hi Virag,
Sorry for the delay, I was on vacations.
I tried your query, but I had some errors, first Candidates table doesn't have study_id.
Anyway, I'm still looking for an explination!
What I found that 'AND' and 'OR' in my query don't actually function like I thought! for example:

Here 'AND' is concating the two strings to be like this condition:
WHERE LIKE '%StudyOne%', which is not what I'm looking for!
Hi Carol,
I don't have a problem in retrieving when I don't use 'and'. The only problem is when i write 'Where <condition1> AND <condition2>'.
Where condition1, condition2 related to table b.
I will examine the database design and the relations carefully. Maybe I missed something in the design stage. I'll post if I reach something (for a reference).
Thanks all.
Thanks Arulanand for your help.
Unfortunately, it gave me the same results. What puzzles me is that both queries work with the OR, but don't work with AND!
so when i write:
Candidates a,
c.cand_num , b.study_id
Studies b
left outer join
CandStudy c on b.study_id = c.study_id
where LIKE '%StudyOne%' AND LIKE '%StudyTwo%'
d where a.cand_num = d.cand_num

it returns empty table while there is one record that meet the criteria.
It's strange!
I'll try with MySQL and post the result.
Ok I edited my post to make it clearer.
Also I exported the database to SQL server express and tested there, it was the same problem. I searched everywhere but couldn't find an answer.
I think many of you guys came to such a query, so I hope one of you can answer me as I think it will pop up a lot in front of me.
How can I select from table A according to conditions from table B while A and B are linked by table AB? I mean is there something wrong with my sql statement?
Is there something I should know about using AND in sql statement?
Thanks for any help or hint.
Hi there,
I don't know if this is the right place, but I hope so.
I am using Access as a database and trying to execute a sql statement but without success.
The tables I have are:

cand_num (PK)

study_id (PK)

cand_num (PK)
study_id (PK)

so they are two tables + one linking table. When I run this statement:

I get nothing, but there is one record who should appear. It gives me not correct results in whatever conditions using AND, when I replace AND with OR, it gives me right results!
Is this a bug in MS Access? or I should write my sql statement differently?
Thanks for any help

[ January 18, 2007: Message edited by: Nawar Gailani ]
[ January 23, 2007: Message edited by: Nawar Gailani ]
Hi Satou,
The web.xml in:

And the three classes in:

The URL is:

Hmmm! I think I found the 'silly' mistake! it is WEB-INF Nawar!!
Ok it is working now and I learned something: "Always prepare a strong coffee before you start coding!"

Thanks for your post Satou, and for this cup of coffee I'm drinking now!
Hi there,
I have an error in Tomcat while trying out this tutorial:

I rechecked everything, and all seem fine! So I started NetBeans (the holy gift) and copy'n'paste all the java sources. Everything just worked fine! I overwrote the classes in my Tomcat directory with the ones compiled from NetBeans, but still the error there! Can anyone help?
Here are the source files (although I don't think this is the problem!):

is there something wrong with my code?
Can I use NetBeans for this exam and skip all that headeache?!
Thanks in advance
[ October 25, 2006: Message edited by: Nawar Gailani ]
As Chandra said, use setIcon() method.

The redo.png image is in images directory which is relative path.
Hope this helps.
18 years ago
Hi there,
Do I need to buy books about design patterns and UML for this exam?
Is it better to read these first?

Hi there,
I have some problems to understand and achieve the results I want. Let's say I have two tables, one for students and the other for courses.
I want to display the student details and the courses he/she did listed beside his/her details in the report. This will lead to two SQL statements:
select * from students
select * from courses where courses.studentID = students.studentID (which will be retrieved from the first statement)
Now, what I use for the second statement? A subreprot?
1.I want to use this report within my application, so the report will depend on the search result (same design) What to read about this?

I really appreciate any links or answers,
Thanks Gregg
Without your help I would stay with that 'ugly' code and keep complaining how 'cmd' is a stupid command from the old dos days!
I also will not forget your info about getting the String from a Java class.
18 years ago
Oh! I think I have to drink a strong coffee to wake up!
You already told me the answer! but I thought it is to execute specific program not a file!
My mistake, sorry
The thing is there is another button that browse for a file, then the file path will be stored in the database, when recall the record the path appears on this label and by pressing the first button, the file will open inside the associated program.
Thanks a lot Gregg, I didn't thought to use backslash before the backslash in the string!
Now I only need to check for a backlash in the String and then apend another one before execute it, right?

[ March 31, 2006: Message edited by: Nawar Gailani ]
18 years ago

Originally posted by Gregg Bolinger:
Well, after reading that link you posted, I tried this...

And it worked great.

Yes Gregg, it works great
I prefered that the file be executed like in the first way whether it has spaces or not, because it is just like double clicking a file (in windows explorer for example) and Windows knows which program associated with this extension because I don't know exactly what format this file will be.
Well, after asking my client (my wife actually) what formats mostly she thinks she will use, she said doc 90% and the remain mostly pdf, so I wrote this code:

And the result is ok.

Thanks again for your time and suggestions
18 years ago
Hi Gregg,
yes I tried it, it just shows the command prompt with the title of archivo value.
I have searched and found
So it seems a problem with cmd in windows as it behaves like the old dos!
Anyway I'm trying now to check the extension of the file, so if it is doc or pdf i open it with word or acrobat repecively, if not i open it with explorer.
If I find a better solution for the spaces in the file name I will post it as a reference.
Thanks for your time
18 years ago