2 messages in com.mysql.lists.javaproblem retrieving data from MySql | Subject: | problem retrieving data from MySql ![]() |
|---|---|
| From: | Sudhir (sud...@unidux.com.sg) |
| Date: | 06/05/2001 09:00:14 PM |
| List: | com.mysql.lists.java |
Hi there,
Using 'request.getParameter()' method I am getting parameter from first page to second page. In second page I am inserting the row. After that when I am trying to retrieve the same data from the table by giving a condition, the query is not retrieving any data. After fighting a lot, I noticed that when I am trying to insert the data into the table along with data it is adding a blank character and storing. Why this is happening I don't know. This problem I got several times, but I overcome this problem by trimming, using '.trim()' method. Can anybody tell me the reason. I am providing my table structure and quires.
My table structure is,
Table Name : currency Columns : curr_code,descr
My quires :
when I am inserting I am using the query,
"insert into currency(curr_code,descr) values('"+curr_code+"','"+descr+"')"; but i am getting these values from the first page using the method 'request.getParameter()' and I am inserting in second page.
when I am retrieving the data from the table,
"select * from currency where curr_code='"+curr_code+"'";
Note : But before inserting into the table, if I am trimming the curr_code(curr_code=curr_code.trim()), I am not getting this problem.
Best Regards, Venkata Sudhir Kurapati Software Consultant Unidux Technologies, 7B,Aliwal Street, Singapore - 199900 DID : +65 - 2934556 Fax : +65 - 2934920 http://www.ectu.com/ http://www.unidux.com.sg/




