ibatis servlet query

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ibatis servlet query

bernouli
This post has NOT been accepted by the mailing list yet.
I tried querying database records using pass variable from ibatis servlets
it works fine and fetch the records if correct pass value is entered but return error message if wrong pass value is entered

eg
[CODE]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">

<sqlMap namespace="Display1">
 

 <select id="getAll"  parameterClass="long" resultClass="Display1">
   select * from account
WHERE pass ='vatri'

</select>
</sqlMap>
[/CODE]


okay now i tried to fetch the record using form inputs from jsp via pass variable in ibatis-servlets, it keeps on returning
error message irrespective of whether correct pass value is entered or not.
when i used input form my query becomes



[CODE]

select * from account
WHERE pass = #pass#

[/CODE]
 
I equally try this query below but it does not work

[CODE]

select * from account
WHERE pass = #pass:Varchar#
[/CODE]

I think the problem is from the query. any help please