Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Concept of a OUT parameter in a CallableStatement

 
Nick Widelec
Ranch Hand
Posts: 226
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is an OUT paramenter? I see that it gets "registered" as callstmt.registerOutParameter(1,"java.sql.Types.XXX)

Could you make an easy understandable example? I thoroughly understand what a IN parameter is (like the preparedStatement).

Thanks in advance.

 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The OUT parameter can be modified by the statement being executed (usually, but not necessarily, this would be a stored procedure). It is the same as parameters passed by reference known from other languages (not from Java, of course). You'll usually read the value of the parameter after the statement was executed, using the getXxx methods of the CallableStatement.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!