Join David Gassner for an in-depth discussion in this video Handling multiple values from stored procedures, part of Java: Database Integration with JDBC.
Many Database Management Systems let you create stored procedures that return more than one…value, for example, in MySQL.…You can create a stored procedure that returns both a result set and one or more of what are called Out Parameters.…Here's the syntax in MySQL, I have provided this code in the file MySQLStoredProcs.txt,…which is part of the free exercise files that accompany this course.…As with any stored procedure in MySQL, you start by setting the DELIMITER to a double…slash or some other String that won't be in conflict with SQL.…
When you create the procedure, you define arguments. Here I am declaring an IN parameter, the same…parameters as I used in a previous exercise, but I'm also defining an OUT parameter, a…value that can be passed back from the stored procedure.…In this stored procedure, I'm executing two separate select statements, the first one…selects the count of rows from the tours table.…It selects the count, but then instead of naming that return value as a part…of the result set as you might do in conventional SQL,…
Author David Gassner explains how to choose a JDBC driver and connect to one or more databases. He also provides detailed instructions on reading, selecting, and updating data; calling stored procedures; managing data via JavaBean classes or with prepared statements; and working with metadata.
- Importing a MySQL database
- Connecting to databases
- Handling JDBC exceptions
- Looping through result sets
- Limiting the number of fetched rows
- Filtering data with prepared statements
- Calling stored procedures
- Inserting, updating, and deleting rows with prepared statements
- Using a persistent database connection
- Committing and rolling back transactions
Skill Level Intermediate
1. Installing Software
2. Getting Started with JDBC
3. Managing Database Resources
Handling JDBC exceptions7m 7s
4. Reading Data
5. Managing Data
6. Using Metadata
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.