• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLException: Missing IN or OUT parameter at index 2

 
Syed Irtaza
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone here knows the solution or the cause?

Database that is in use is Oracle 12c.



 
Maneesh Godbole
Saloon Keeper
Posts: 11312
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does this seem right to you? Hint the exception says index 2
 
Syed Irtaza
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha got it, damn my bad xD .
Thank man
 
Maneesh Godbole
Saloon Keeper
Posts: 11312
16
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
Dave Tolls
Ranch Hand
Posts: 2091
15
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you actually need to cast those variables to the Oracle-specific ones?
That's is very rarely needed.
 
chris webster
Bartender
Posts: 2407
33
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Dave says, if you are just checking that a given user/password combination exists in the database, you do not actually need to fetch them back into your Java application. You could just fetch a dummy value e.g. 1. If the query returns a result, you know the user exists. If no result is returned, you know it doesn't exist. This also means you can avoid fetching user passwords out of the database, which could be a security risk.
 
Syed Irtaza
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chris webster wrote:As Dave says, if you are just checking that a given user/password combination exists in the database, you do not actually need to fetch them back into your Java application. You could just fetch a dummy value e.g. 1. If the query returns a result, you know the user exists. If no result is returned, you know it doesn't exist. This also means you can avoid fetching user passwords out of the database, which could be a security risk.



NOTED.
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also try to UseAMeaningfulSubjectLine next time when creating a new topic. If you compare "SEVERE: null" and "SQLException: Missing IN or OUT parameter at index 2", then the latter one is much more descriptive about the issue/prolem you were facing than the first one. I updated the subject accordingly, hope that's ok with you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic