Looking for the best in Help Desk Software, visit Novo Solutions.

SQLite with C + + Example: A pact without the options of the server database

January 12, 2011

You have a job, you’ll need to store and retrieve data from a SQL database, but should not make the effort, a solution of client and server? Today we will introduce SQLite, which was made for you. In addition to the small free library, and it’s a complete and easy as a container with a SQL database to a text file that is stored locally in the application. What this means is that you create and implement all the tables in a large structure in the design of your database and construction of complex data queries than any other supported database, SQL Server, with the exception of the database is no local file or client server architecture is not required. SQLite website:

SQLite is a library that implements a method in itself, no servers, no configuration, the engine of SQL database transaction. The code for SQLite is public domain and thus free for use for any purpose, commercial or private. SQLite is currently more demand than we can count, including several high-profile projects

SQLite is easy to configure and name with Tcl C / C + + interfaces and a power base of users, including Adobe, Firefox, Microsoft, Apple, Google and McAfee, a few.  Just to show how easy it is to use SQLite in a program in C + +, here are a few lines of code that help you understand how easy it is to use SQLite is and how it might be a good choice for your needs are:

#include <sqlite3.h>
sqlite3* db;
char* db_err;
int main() {
sqlite3_open(“my_db.sql3”, &db);
sqlite3_exec(db, “create table ‘helloworld’ (id integer);”, NULL, 0, &db_err)
sqlite3_close(db);
}

And that’s mantle. You pass a valid SQL statement for sqlite3_exec () to handle all the databases. Data recovery is passed through the settings in a callback function specified by the user (not used in this example, and therefore void). In any case, this simple example should suffice to help you get started working with SQLite for their new project.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

UK Webmaster SEO Forum