File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to search record on (firstname+lastname) or (lastname+firstname)? please help me

 
Gautam Ry
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I need your help to resolve the following issue.please, help me.
I need to search employee on (firstname+lastname) or (lastname+firstname). SQL-2000 is DB.
the piece of code is as follows


On execution, I am getting "nested exception is: java.sql.SQLException: [IBM][SQLServer JDBC Driver]Invalid parameter binding(s). "

How to resolve? please, help me.

regards
Gautam


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the SQL behind qryforEmployeeSearch_fullname ?
 
Gautam Ry
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is as below

private static final String qryforEmployeeSearch_fullname ="select e.emp_eid, rtrim(ltrim(e.emp_firstname)) +' '+rtrim(ltrim(emp_lastname))+' ['+e.emp_eid+']' as emp_name," +
" e.emp_tm_tid as teamname from tblEmployee e where " +
"(e.emp_lastname like ? and e.emp_firstname like ?)or (e.emp_firstname like ? and e.emp_lastname like ?) order by e.emp_firstname ";

regards
Gautam
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have four bind parameters declared but you only bind two. You'll need to bind all of these.
 
Gautam Ry
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
many many thanks to you. it's working as i changed
regards
gautam
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic