This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes java.lang.IllegalArgumentException: Parameter UserName does not exist  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "java.lang.IllegalArgumentException: Parameter UserName does not exist  " Watch "java.lang.IllegalArgumentException: Parameter UserName does not exist  " New topic
Author

java.lang.IllegalArgumentException: Parameter UserName does not exist

R Naijat
Ranch Hand

Joined: Nov 01, 2011
Posts: 40
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

Joined: Nov 01, 2011
Posts: 40
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
 
subject: java.lang.IllegalArgumentException: Parameter UserName does not exist
 
Similar Threads
Need Help in to write query using StringBuffer
login problem
Order of SQL WHERE clause conditions & database table with index
How to query a value typed object
case sensitive sql statement for username and password