O'Reilly logo

Apache Derby—Off to the Races: Includes Details of IBM® Cloudscape™ by Dan Scott, George Baklarz, Paul C. Zikopoulos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stored Procedures

Stored procedures are a method for encapsulating SQL and logic on the database server. There are many advantages to placing routines on the server, including access to large server resources, minimizing network communication, reuse of code, and security. Placing frequently used code in a stored procedure can also make it easier to develop applications because much of the logic might already be coded.

Three steps are required to get a stored procedure to work:

  • Create the server-side stored procedure.
  • Define the stored procedure to the database.
  • Create the application program that will use the stored procedure.

Each step is outlined in the following sections.

Creating a Stored Procedure

Writing a stored procedure is no different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required