Book Image

Learning SQLite for iOS

By : Gene Da Rocha
Book Image

Learning SQLite for iOS

By: Gene Da Rocha

Overview of this book

The ability to use SQLite with iOS provides a great opportunity to build amazing apps. Apple's iOS SDK provides native support for SQLite databases. This combination offers the potential to create powerful, data-persistent applications. This book starts with the architecture of SQLite database and introduces you to concepts in SQL . You will find yourself equipped to design your own database system, administer it, and maintain it. Further, you will learn how to operate your SQLite databases smoothly using SQL commands. You will be able to extend the functionality of SQLite by using its vast arsenal of C API calls to build some interesting, exciting, new, and intelligent data-driven applications. Understand how Xcode, HTML5, and Phonegap can be used to build a cross-platform modern app which can benefit from all these technologies - all through creating a complete, customizable application skeleton that you can build on for your own apps.
Table of Contents (15 chapters)
Learning SQLite for iOS
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

SQL injection attacks


Another issue with SQLite and SQL statements generally is SQL injection attacks. These can deface websites, result in data corruption, and also affect the reputation of your website and its customers. If the input to SQL parameters is direct, then a weakness could be penetrable. SQL data input must be checked and filtered to allow no one to change the current statement with data elements or even replace SQL statements to perform corrupt acts. This can be done using this statement:

SELECT * from property where property_name='%s';

The preceding code shows that an injection can take place where %s is the input string, and it can be changed to be something else, thus changing the outcome result. To protect SQL, constrain the input, use parameters with stored procedures, and use parameters with dynamic SQL to reduce the threats.

To prevent your website from being used for XSS or XSRF attacks, disallow the HTML tags in text input provided by users by using functions to find...