| Author |
resultset return null
|
Essam AbdelAziz
Ranch Hand
Joined: Mar 10, 2007
Posts: 34
|
|
Dear All i'm trying tp read Some Date From My table in DB the table consist of 2 coulmns Name1,Name2 when i try to get Name1 like this String Name1=resultset.getString("Name1"); it will return Name1 with out any problems but when i try to get Name2 like this String Name2=resultset.getString("Name2"); it will return null although name2 is contain "essam" in DB so what is the problem...? thank you
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
Your question has nothing to do with JSP, you should post it in JDBC forum. anyways back to your problem, could you please post your code here, either there is some problem with code or column name2 does not have data. Thanks, Shailesh
|
Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
|
 |
Essam AbdelAziz
Ranch Hand
Joined: Mar 10, 2007
Posts: 34
|
|
no it has acorrect data as i mentioned before thank you
|
 |
Shailesh Chandra
Ranch Hand
Joined: Aug 13, 2004
Posts: 1076
|
|
could you please post your code ?? Shailesh
|
 |
Baseet Ahmed
Ranch Hand
Joined: Dec 18, 2006
Posts: 223
|
|
Hi, Can you put your code snippet on the forum? --------------------------------- Tip:Modesty is all virtue.
|
 |
Parthasarathy balakrishnan
Greenhorn
Joined: Apr 20, 2007
Posts: 14
|
|
when i try to get Name1 like this String Name1=resultset.getString("Name1"); it will return Name1 with out any problems but when i try to get Name2 like this String Name2=resultset.getString("Name2"); it will return null although name2 is contain "essam" in DB from your code i can suggest that: check for the following changes: 1.check for the column name in the database that it is like Same us you have give in the getString method(); 2.else do not struck with that please put the code rs.getString(2) if you want the value of 2nd column example code: System.out.println(rs.getString(1) +"\t"+rs.getString(2)); by,
|
Thanks and Regards,<br />-------------------<br />Parthasarathy Balakrishnan,<br />Bangalore.
|
 |
Mr. C Lamont Gilbert
Ranch Hand
Joined: Oct 05, 2001
Posts: 1170
|
|
|
Perhaps that column was not part of the resultset.
|
 |
 |
|
|
subject: resultset return null
|
|
|