taiping
asked on
How to do this...??
i have this data as a schema.
Field 1 : Field 2
A
A Testing 1
A Testing 2
A
A
A 168
It's blank and not "null". And i am using MS Sql.
When i do this,
while (rs.next()) {
out.println("rs.getString( "Field2")) ;
out.println("<BR>");
}
it's print out this;
Testing1
Testing2
168
Where by there is a space in between the testing2 and 168. means it's printing out the blank space as well.
I added this.
while (rs.next()) {
if (rs.getString("Field2")!=n ull || rs.getString("Field2")!="" ) P
out.println("rs.getString( "Field2")) ;
out.println("<BR>");
}
}
but the result is still the same. What happend???
Field 1 : Field 2
A
A Testing 1
A Testing 2
A
A
A 168
It's blank and not "null". And i am using MS Sql.
When i do this,
while (rs.next()) {
out.println("rs.getString(
out.println("<BR>");
}
it's print out this;
Testing1
Testing2
168
Where by there is a space in between the testing2 and 168. means it's printing out the blank space as well.
I added this.
while (rs.next()) {
if (rs.getString("Field2")!=n
out.println("rs.getString(
out.println("<BR>");
}
}
but the result is still the same. What happend???
Try:
while (rs.next()) {
if (rs.getString("Field2")!=n ull || (rs.getString("Field2")).l ength()>0) {
out.println("rs.getString( "Field2")) ;
out.println("<BR>");
}
}
Javier
while (rs.next()) {
if (rs.getString("Field2")!=n
out.println("rs.getString(
out.println("<BR>");
}
}
Javier
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The problem is that you where putting and .OR. || instead of .AND. &&.
your fisrt code wil probably work too
Javier
your fisrt code wil probably work too
Javier
ASKER
:-)