Article Preview
Buy Now
FEATURE
Data Access
Three Paradigms for Data Access in Xojo
Issue: 13.1 (January/February 2015)
Author: Kevin Cully and Scott Boss
Author Bio: Kevin Cully currently is owner of CULLY Technologies, LLC. He leads the Atlanta Xojo Users Group and is an avid Xojo developer on Linux and other Xojo target platforms.
Article Description: No description available.
Article Length (in bytes): 18,493
Starting Page Number: 21
Article Number: 13104
Related Web Link(s):
http://http
http://www.bkeeney.com/allproducts/argen/
http://www.bkeeney.com/rbinto/activerecord/
Excerpt of article text...
Today we're not going to talk about different databases—SQLite, PostgreSQL, MySQL, Oracle, etc.—but about the programming side of data access.
There are three approaches that we are going to discuss: SQL Pass Through, Prepared SQL Statement, and Object Relational Mapping. We're hoping this gives you an insight into the pluses and minuses of each approach to help you get started programming in Xojo using databases.
If you want to know more about SQL beyond the scope of this article, there is a huge volume of information on the Internet for you to reference.
Database Fundamentals
First, let us discuss database operations from the very beginning with the fundamentals. Databases are used to permanently store data and subsequently retrieve that data. The way to ask for data is typically called SQL or "Structured Query Language." There are only a couple of basic database operations:
SELECT
,INSERT
,UPDATE
, andDELETE
. TheINSERT
,UPDATE
, andDELETE
operations deal with manipulating data. TheSELECT
operation deals with returning data or querying data. When we execute aSELECT
statement, we expect to get a recordset back in Xojo. ForINSERTs
,UPDATEs
, andDELETEs
we check if there was an error after the operation by checking the error property on the database connection.Approach 1: SQL Pass Through
...End of Excerpt. Please purchase the magazine to read the full article.