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

java.lang.IllegalArgumentException: Parameter UserName does not exist

 
R Naijat
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I connect and run queries against Oracle DB using Hibernate. I have the following piece of code:



I receive the following error:



Does anybody know what am I doing wrong? Any help is greatly appreciated.


 
R Naijat
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the query, UserName and UserId refer to the columns in the db which actually are not case sensitive; however, :username and :userId are parameters that we need to set values for, so setString("username", username), the first item is case sensitive and should match what we have in :username, and setInteger("userId", userId): the first parameter should match what we have in :userId.

So the following works with no error:



Thought it might help somebody.


 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic