GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing docs.voltdb.com — Chapter 7. Simplifying Application Development DocumentationChapter 7. Simplifying Application DevelopmentThe previous chapter (Chapter 6, Designing VoltDB Client Applications) explains how to develop your VoltDB database application using the full power and flexibility of the Java client interface. However, some database tasks — such as inserting records into a table or retrieving a specific column value — do not need all of the capabilities that the Java API provides. Now that you know how the VoltDB programming interface works, VoltDB has features to simplify common tasks and make your application development easier. Those features include: The following sections describe each of these features separately. 7.1. Using Default ProceduresAlthough it is possible to define quite complex SQL queries, often the simplest are also the most common. Inserting, selecting, updating, and deleting records based on a specific key value are the most basic operations for a database. Another common practice is upsert, where if a row matching the primary key already exists, the record is updated — if not, a new record is inserted. To simplify these operations, VoltDB defines these default stored procedures for tables. The default stored procedures use a standard naming scheme, where the name of the procedure is composed of the name of
the table (in all uppercase), a period, and the name of the query in lowercase. For example, the Hello World tutorial
( VoltDB defines a default insert stored procedure when any table is defined:
VoltDB defines default update, upsert, and delete stored procedures if the table has a primary key:
VoltDB defines a default select stored procedure if the table has a primary key and the table is partitioned:
Use the sqlcmd command show procedures to list all the stored procedures available including the
number and type of parameters required. Use The following code example uses the default procedures for the HELLOWORLD table to insert, retrieve (select), update, and delete a new record with the key value "American": VoltTable[] results;
client.callProcedure("HELLOWORLD.insert",
"American","Howdy","Earth");
results = client.callProcedure("HELLOWORLD.select",
"American").getResults();
client.callProcedure("HELLOWORLD.update",
"American","Yo","Biosphere",
"American");
client.callProcedure("HELLOWORLD.delete",
"American"); | ||||||||||
| 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. |