GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • V8.x Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — 6.2. Invoking Stored Procedures

  • Volt Active Data
  • Feedback/Discuss
  • Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Guide to Performance and Customization
    • VoltDB Planning Guide
    • VoltDB Administrator's Guide
    • VoltDB Quick Reference
  • Current docs ▶
  • VoltDB V8 LTS
    • VoltDB V16
    • VoltDB V15.3 LTS
    • VoltDB V14.3 LTS
    • VoltDB V13.3 LTS
    • VoltDB V12.3 LTS
    • VoltDB V11.4
    • VoltDB V10.2
    • VoltDB V9.3
6.2. Invoking Stored Procedures

Documentation

VoltDB Home » Documentation » Using VoltDB
< previoustable of contentsnext >

6.2. Invoking Stored Procedures

After your client creates the connection to the database, it is ready to call the stored procedures. You invoke a stored procedure using the callProcedure() method, passing the procedure name and variables as arguments. For example:

VoltTable[] results;
 
try { results = client.callProcedure("LookupFlight",              1
                                     origin,
                                     dest,
                                     departtime).getResults();    2
} catch (Exception e) {                                           3
     e.printStackTrace();
     System.exit(-1);
}

1

The callProcedure() method takes the procedure name and the procedure's variables as arguments. The LookupFlight() stored procedure requires three variables: the originating airport, the destination, and the departure time.

2

Once a synchronous call completes, you can evaluate the results of the stored procedure. The callProcedure() method returns a ClientResponse object, which includes information about the success or failure of the stored procedure. To retrieve the actual return values you use the getResults() method. See Section 5.2.4, “Interpreting the Results of SQL Queries” for more information about interpreting the results of VoltDB stored procedures.

3

Note that since callProcedure() can throw an exception (such as VoltAbortException) it is a good practice to perform error handling and catch known exceptions.

< previoustable of contentsnext >
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.