Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Database Systems - Java Database Programming with Stored Procedure Calls - CallableStatement
Play lesson

Database Systems with SQL - Full Course - Database Systems - Java Database Programming with Stored Procedure Calls - CallableStatement

5.0 (0)
6 learners

What you'll learn

This course includes

  • 4.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Stored procedure calls MySQL procedural SQL includes stored procedures, which are stored in the database and can be called by Java code. Stored procedure parameters can be IN for input or OUT for output. CallableStatement - interface that extends PreparedStatement with methods that call stored procedures. prepareCall() – creates CallableStatement objects with your database connection executeQuery() – executes the stored procedure call setInt() - sets the IN parameter to the given Java int value. setString() - sets the IN parameter to the given Java String value. registeredOutParameter() - sets the OUT parameter to the JDBC type. In the code shown: The RMovieCount stored procedure counts the number of R movies. The prepareCall() method creates a CallableStatement object with the RMovieCount stored procedure. setString() binds the movie parameter. registerOutParameter() binds the count parameter. executeQuery() executes the stored procedure. getString(2) returns the count parameter. Subscribe to Appficial for more programming videos coming soon. Also, don't forget to click LIKE and comment on the video if it helped you out!

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

FAQs

Course Hive
Download CourseHive
Keep learning anywhere