U
umashd
Hi
I am beginner doing a project for my graduation. The simple code I
developed makes me go crazy. Problemaic code is below.
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount=rsmd.getColumnCount();
while ( rs.next() )
{
out.println("<BR>Check point Row No : " + rs.getRow() );
for (int i=1; i<=columnCount; i++)
{
String cValue=rs.getString(i);
out.println("<BR> Column Value =" +cValue );
if (cValue.equalsIgnoreCase(searchString))
{
out.println("<BR><B> Record Found. Row:" +rs.getRow() +"</B>");
}
}
}
Basically, I get the ResultSet from the database and search for a
string searchString in all column values. It works fine but only one
itration. ie the while loop terminates after the first itration. When I
remove the if condition, or change the condition with litrals (if ("z"
== "z")...) it works. I do not know what is worng with the code or my
logic. Can any one help me?
Uma
I am beginner doing a project for my graduation. The simple code I
developed makes me go crazy. Problemaic code is below.
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount=rsmd.getColumnCount();
while ( rs.next() )
{
out.println("<BR>Check point Row No : " + rs.getRow() );
for (int i=1; i<=columnCount; i++)
{
String cValue=rs.getString(i);
out.println("<BR> Column Value =" +cValue );
if (cValue.equalsIgnoreCase(searchString))
{
out.println("<BR><B> Record Found. Row:" +rs.getRow() +"</B>");
}
}
}
Basically, I get the ResultSet from the database and search for a
string searchString in all column values. It works fine but only one
itration. ie the while loop terminates after the first itration. When I
remove the if condition, or change the condition with litrals (if ("z"
== "z")...) it works. I do not know what is worng with the code or my
logic. Can any one help me?
Uma