Main > Free Download Search >

Free sqlite examples software for linux

sqlite examples

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3404
GNUstep examples 1.1.0

GNUstep examples 1.1.0


GNUstep examples is a collection of programs that are meant to show programmers how to use GNUstep. more>>
GNUstep examples is a collection of programs that are meant to show programmers how to use GNUstep.
GNUstep examples includes a calculator, a currency converter, finger, fractal, puzzle, hostaddress, and ink (a simple editor).
Enhancements:
- Minor feature enhancements
<<less
Download (0.23MB)
Added: 2006-09-13 License: GPL (GNU General Public License) Price:
1140 downloads
SQLitepp

SQLitepp


SQLitepp is a multilanguage object oriented wrapper to the sqlite library. more>>
SQLitepp is a C/C++/Python wrapper to sqlite library for database management. It implements an object oriented way to manipulate the database in every supported language.

SQLitepp supports selfupdatable queries and a straight SQL code query system without using strange things for querying the database, letting you manipulate it directly in SQL but also exposing simple object oriented methods to manipulate the result of the queries and updating them.

Python EXAMPLE:

db = SQLDatabase("database.db")
q = db.query("Tablename", "SELECT Name,Id FROM %t")
if len(q):
tuple1 = q[0]
tuple1["Name"] = "Foobar"
tuple1.commit()
del db

C++ EXAMPLE:

SQLDatabase db("database.db");
SQLQuery *q = db.query("Tablename", "SELECT Name,Id FROM %t");
if(q->numberOfTuples()) {
SQLRow *tuple1 = q->getRow(0);
tuple1->set("Name", "Foobar");
tuple1->commit();
}
delete q;

C EXAMPLE:

void *db = new_SQLDatabase("database.db");
void *q = SQLDatabase_query(db, "Tablename", "SELECT Name,Id FROM %t");
if(SQLQuery_numberOfTuples(q)) {
void *tuple1 = SQLQuery_getRow(q, 0);
SQLRow_set(tuple1, "Name", "Foobar");
SQLRow_commit(tuple1);
}
delete_SQLQuery(q);
delete_SQLDatabase(db);
<<less
Download (0.019MB)
Added: 2005-09-26 License: LGPL (GNU Lesser General Public License) Price:
1489 downloads
sqlitewrapped 1.3

sqlitewrapped 1.3


sqlitewrapped is a C++ wrapper for the Sqlite database C application programming interface. more>>
sqlitewrapped is a C++ wrapper for the Sqlite database C application programming interface.
The code works for linux/unix, as well as win32. This library supports version 3 of the sqlite database. From version 1.2 the connection pool can be made threadsafe.
Examples:
#include < stdio.h>
#include < stdlib.h>
#include < sqlite3.h>
#include < string>
#include "Database.h"
#include "Query.h"
int main()
{
Database db( "database_file.db" );
Query q(db);
q.execute("delete from user");
q.execute("insert into user values(1,First Person)");
q.execute("insert into user values(2,Another Person)");
q.get_result("select num,name from user");
while (q.fetch_row())
{
long num = q.getval();
std::string name = q.getstr();
printf("User#%ld: %sn", num, name.c_str() );
}
q.free_result();
}
Enhancements:
- This release adds methods to access values in the result set by column name.
<<less
Download (0.015MB)
Added: 2006-04-05 License: GPL (GNU General Public License) Price:
1300 downloads
DTLS Client/Server Example 0.2

DTLS Client/Server Example 0.2


DTLS Client/Server Example contains a simple DTLS client and DTLS server. more>>
DTLS Client/Server Example contains a simple DTLS client and DTLS server to show how to send UDP data over an encrypted channel using OpenSSL DTLSv1 support.

LIST OF FILES:

Directory: common - Contains callback functions and error reporting functions common to client and server

sslmgr.h
sslmgr.c

Directory: dtls_server

dtls_server.c - DTLS server part

Directory: dtls_client

dtls_client.c - DTLS client part

<<less
Download (0.010MB)
Added: 2006-11-03 License: Free For Educational Use Price:
1092 downloads
SQLite 3.4.2

SQLite 3.4.2


SQLite is an embeddable SQL engine in a C library. more>>
SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.
Main features:
- Transactions are atomic, consistent, isolated, and durable (ACID) even after system crashes and power failures.
- Zero-configuration - no setup or administration needed.
- Implements most of SQL92. (Features not supported)
- A complete database is stored in a single disk file.
- Database files can be freely shared between machines with different byte orders.
- Supports databases up to 2 terabytes (241 bytes) in size.
- Sizes of strings and BLOBs limited only by available memory.
- Small code footprint: less than 30K lines of C code, less than 250KB code space (gcc on 486)
- Faster than popular client/server database engines for most common operations.
- Simple, easy to use API.
- TCL bindings included. Bindings for many other languages available separately.
- Well-commented source code with over 95% test coverage.
- Self-contained: no external dependencies.
- Sources are in the public domain. Use for any purpose.
The SQLite distribution comes with a standalone command-line access program (sqlite) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.
Create A New Database:
- At a shell or DOS prompt, enter: "sqlite3 test.db". This will create a new database named "test.db". (You can use a different name if you like.)
- Enter SQL commands at the prompt to create and populate the new database.
Write Programs That Use SQLite
Below is a simple TCL program that demonstrates how to use the TCL interface to SQLite. The program executes the SQL statements given as the second argument on the database defined by the first argument. The commands to watch for are the sqlite3 command on line 7 which opens an SQLite database and creates a new TCL command named "db" to access that database, the invocation of the db command on line 8 to execute SQL commands against the database, and the closing of the database connection on the last line of the script.
#!/usr/bin/tclsh
if {$argc!=2} {
puts stderr "Usage: %s DATABASE SQL-STATEMENT"
exit 1
}
load /usr/lib/tclsqlite3.so Sqlite3
sqlite3 db [lindex $argv 0]
db eval [lindex $argv 1] x {
foreach v $x(*) {
puts "$v = $x($v)"
}
puts ""
}
db close
<<less
Download (2.1MB)
Added: 2007-08-14 License: Public Domain Price:
551 downloads
SQLiteDBMS 0.5.1

SQLiteDBMS 0.5.1


SQLiteDBMS is a database management server for SQLite. more>>
SQLiteDBMS is a database management server for SQLite. SQLiteDBMS project allows an sqlite3 process to be accessed via a TCP/IP network.
It provides Extended SQL, basic authentication, and access control. It includes a simple Web server that takes HTTP requests and sends XML responses.
To compile the project, first create a directory in which to place the build products. It is recommended, but not required, that the build directory be separate from the source directory. Cd into the build directory and then from the build directory run the configure script found at the root of the source tree. Then run "make".
For example:
tar xzf sqlitedbms-x.y.z.tar.gz ;# Unpack the source tree into "sqlitedbms"
cd sqlitedbms-x.y.z ;# Move into directory
./configure --with-sqlite3=DIR ;# Run the configure script
make ;# Run the makefile.
Enhancements:
- Some bugs were fixed.
- Stability was improved.
<<less
Download (0.44MB)
Added: 2006-11-15 License: BSD License Price:
1075 downloads
VSQLite++ 0.3

VSQLite++ 0.3


VSQLite++ is a portable SQLite wrapper library for C++. more>>
VSQLite++ is a portable SQLite wrapper library for C++.
Supported Compilers
- GCC and G++ 4.x (maybe 3.4.x too, but it wasnt tested until now)
- Visual C++ 8/2005 (Visual C++ 7.1/2003 wasnt tested, maybe will be added later)
<<less
Download (0.92MB)
Added: 2006-10-23 License: BSD License Price:
1096 downloads
Learn HTML By Example 1.03

Learn HTML By Example 1.03


Learn HTML By Example is a sweet little JavaScript / HTML program. more>>
Learn HTML By Example is a sweet little JavaScript / HTML program that allows you to see the HTML you input into on side displayed as a web page on the other.
To install the program, just download it from Web Design Factory, and upload it to your web site.
Main features:
- Easy installation. Just upload to your web site and youre done!
- Immediate feedback on testing HTML and CSS code
- Several examples of commonly used HTML and CSS elements
- No page refreshing required
- Easy to expand by adding new examples
<<less
Download (0.008MB)
Added: 2005-12-19 License: Freeware Price:
1406 downloads
phpSQLiteAdm 0.1.0

phpSQLiteAdm 0.1.0


phpSQLiteAdm is an application to provide Web based management and administration for SQLite databases. more>>
phpSQLiteAdm is an application to provide Web based management and administration for SQLite databases.
phpSQLiteAdm project is meant to be similar to phpMyAdmin. It provides functionality to view data, to add and drop tables, views, and indexes, to export data, to add and delete rows, and to query the database.
Enhancements:
- This is the initial release.
- Code cleanup and bugfixes were done.
<<less
Download (0.066MB)
Added: 2006-12-19 License: GPL (GNU General Public License) Price:
1039 downloads
SQLiteJDBC 034

SQLiteJDBC 034


SQLiteJDBC supports the most commonly used features of JDBC that can be efficiently implemented on top of SQLite. more>>
SQLiteJDBC is a JDBC driver for SQLite which is written as a Java JNI layer over the SQLite 3.3.x API.

SQLiteJDBC supports the most commonly used features of JDBC that can be efficiently implemented on top of SQLite. Only a single native JNI library is required, and SQLite is compiled in.

Binaries are provided for Linux, Mac OS X, and Windows.

<<less
Download (0.13MB)
Added: 2007-06-19 License: BSD License Price:
521 downloads
PySQLite 2.3.5

PySQLite 2.3.5


pysqlite is a Python DB-API 2.0 interface for the SQLite embedded relational database engine. more>>
pysqlite is a Python DB-API 2.0 interface for the SQLite embedded relational database engine.
Enhancements:
- pysqlite is now 2.5 times faster for DML statements.
- This pays off especially for bulk-loading data.
- pysqlite now recognizes if the database engine has done an implicit ROLLBACK and acts accordingly.
- Using custom mapping and sequence types in parameters works now.
<<less
Download (0.083MB)
Added: 2007-07-18 License: zlib/libpng License Price:
517 downloads
pam_sqlite 0.3

pam_sqlite 0.3


pam_sqlite allows developers to authenticate users against a table in an SQLite database. more>>
pam_sqlite allows developers to authenticate users against a table in an SQLite database. pam_sqlite supports checking account information (pam_acct_expired, new_authtok_reqd) and updating authentication tokens.

Compilation & Installation

pam_sqlite is autoconfed, thus, compiling should be a matter of:

$ ./configure
$ make
$ make install

Compilation has been tested on RedHat Linux 7.3.

You will need to have SQLite library and header files for this module to compile.

See test.c for an example application that authenticates using this module.

Configuration:

For the service you wish the module to be used, you need to edit the /etc/pam.d/ file or /etc/pam.conf, and add the relevant lines.

For example:

auth required pam_sqlite.so
account required pam_sqlite.so
password required pam_sqlite.so

Configure the database, and table the module should use with the configuration file /etc/pam_sqlite.conf. An example of this file:

database = /etc/sysdb
table = account
user_column = user_name
pwd_column = user_password
expired_column = acc_expired
newtok_column = acc_new_pwreq
debug

expired_column tells PAM if the user account has expired. Set it to 1 or y if it has.
newtok_column tells PAM if the user needs a new password. Set it to 1 or y if it does.

Note that for backwards compatibility with earlier versions, options specified in the configuration file can be supplied as module arguments as well. Module arguments will override the configuration file.

Configuration Options:

database - the database which should be connected to
user_column - the column containing usernames
pwd_column - the column containing the passwords
expired_column - this column should contain 1 or y if the account
has expired
newtok_column - this column should contain 1 or y if the user
needs to change their password
debug - this is a standard module option that will enable
debug output to syslog (takes no values)
pw_type - specifies the password encryption scheme, can be one
of clear, md5, or crypt. defaults to clear.
config_file - specifies the path to a file to read for further
configuration options
sql_verify - specifies SQL template to use when verifying the
the password for a user
sql_check_expired - SQL template to use when checking for account expiry.
sql_check_newtok - SQL template to use when checking to see if the user
needs to change their password.
sql_set_passwd - SQL template to use when updating the password for
and user.
<<less
Download (0.011MB)
Added: 2006-05-17 License: GPL (GNU General Public License) Price:
1255 downloads
DBIx::Simple::Examples 1.30

DBIx::Simple::Examples 1.30


DBIx::Simple provides a simplified interface to DBI, Perls powerful database module. more>>
[COPRIGHT=1]

EXAMPLES

General

#!/usr/bin/perl -w
use strict;
use DBIx::Simple;

# Instant database with DBD::SQLite
my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat)
or die DBIx::Simple->error;

# Connecting to a MySQL database
my $db = DBIx::Simple->connect(
DBI:mysql:database=test, # DBI source specification
test, test, # Username and password
{ RaiseError => 1 } # Additional options
);

# Using an existing database handle
my $db = DBIx::Simple->connect($dbh);

# Abstracted example: $db->query($query, @variables)->what_you_want;

$db->commit or die $db->error;

Simple Queries

$db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error;

for (1..100) {
$db->query(
INSERT INTO randomvalues VALUES (?, ?),
int rand(10),
int rand(10)
) or die $db->error;
}

$db->query(
INSERT INTO sometable VALUES (??),
$first, $second, $third, $fourth, $fifth, $sixth
);
# (??) is expanded to (?, ?, ?, ?, ?, ?) automatically

Single row queries

my ($two) = $db->query(SELECT 1 + 1)->list;
my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list;

my ($name, $email) = $db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->list;

Or, more efficiently:

$db->query(SELECT 1 + 1)->into(my $two);
$db->query(SELECT 3, 2 + 2)->into(my ($three, $four));

$db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->into(my ($name, $email));

<<less
Download (0.015MB)
Added: 2007-05-10 License: Public Domain Price:
897 downloads
Java::Import::Examples 0.03

Java::Import::Examples 0.03


Java::Import::Examples is an example of how to use Java::Import to call into Java classes. more>>
Java::Import::Examples is an example of how to use Java::Import to call into Java classes.

Making RMI calls from Perl

One nice thing about Java is the extremely straight forward manner in which it allows you to make calls to remote objects residing on distant servers. Many people use this ability as a point of integration between their system and a posible third party or legacy system. Unfortunatly, for the most part the ability to make calls to these remote objects is something that only other Java applications can do without making a big fuss about it. However, we can now do this from Perl.

Assume that I have a RMI server from which I can get data from in the form of simple Java Beans. One method of doing this is to use the GCJ::Cni library and natively compile and wrap a set of Java Classes which can then be used from my Perl script. However, there is an easier way.

Lets begin by descriping the Java interfaces that well be working with. We first have the Remote Interface that we will be interacting with:

import java.rmi.*;
public interface RemoteInterface extends Remote {
public SomeBean getMessage(String seedMessage) throws RemoteException;
}
And we also have the bean we will be asking for:
import java.io.*;
public class SomeBean implements Serializable {
private String value;
public SomeBean() {}
public void setValue ( String _value ) { ... }
public String getValue ( ) { ... }
}
As far as any Perl client program is concerned this is all we need to know about.
Now all there is left to do is write a client:
use Java::Import qw(
java.rmi.Naming
);

my $remote_interface = java::rmi::Naming->lookup(jstring("//localhost/Home"));
my $bean = $remote_interface->getMessage(jstring("Hi there"));
print $bean->getValue(), "n";

Thats all there is. Notice that all we had to tell Java::Import about was java.rmi.Naming, this is because it was the only class we used by name in our Perl code, every other Java class (the objects held by $bean and $remote_interface) was returned by some other method call originating from java.rmi.Naming.

In order to run this example we have to make sure everything is in its place. We start by compiling the client code. Assuming that we have been given a Stub class file (RemoteObject_Stub.class) we can do the following:

gcj -C SomeBean.java RemoteInterface.java
fastjar -cvf client.jar SomeBean.class RemoteInterface.class RemoteObject_Stub.class

Making sure our server is reachable we can then run the client code:

CLASSPATH=client.jar perl client.pl

Thats it, you should then see the message returned by your server.

<<less
Download (0.028MB)
Added: 2007-06-01 License: Perl Artistic License Price:
876 downloads
GCJ::Cni::Examples 0.03

GCJ::Cni::Examples 0.03


GCJ::Cni::Examples is a Perl module with examples of how to use GCJs CNI interface to write Perl Modules in Java. more>>
GCJ::Cni::Examples is a Perl module with examples of how to use GCJs CNI interface to write Perl Modules in Java.

EXAMPLES

Writing Treaded modules in Java

One benefit of using GCJ is that it takes advantage of POSIX threading. This is nice since Perls threading model is, shall we say, less than ideal. Now, you could theoretically write a module in C or C++ and and use the standard POSIX library to do your threaded work for you, however, why not take advantage of the nice Threading interface that Java provides to you by default. This may also come in handy if you have a massively threaded Java library that youd like to call from Perl.

For this example assume that I want to do matrix multiplication, albeit in a very crazy manner. Therefore, I will write a Java class, Matrix, and a method, multiply, which will take another matrix to perform the operation between. Heres the crazy part, for each cell in the resulting matrix I will spawn a new thread, as an internal class, and give it a row and a column from which they will derive the result. I know this is a little wierd but the point is that Ill be spawning a lot of new threads. To multiply two 10x10 matrices we will have to spawn 100 threads (one thread per cell in the resulting 10x10 matrix). Imagine doing this in Perl, then imagine doing it in Java; natively compiled Java. Much faster and a lot less headaches.

The Java Interface/pseudocode is as follows:

public class Matrix {
public Matrix ( int numRows, int numCols ) {
...Constructor stuff...
}

public void set ( int row, int col, int val ) {
...set an element...
}

public int get ( int row, int col ) {
...get an element...
}

public Matrix multiply ( Matrix times ) {
...set it up...
for ( int i = 0; i < rows; i++ ) {
for ( int j = 0; j < times.getCols(); j++ ) {
//GO NUTS!!!!
ArrayMultiplier multiplier = new ArrayMultiplier(this, times, result, i, j);
multiplier.start();
...etc...
}
}
...wait for the threads to exit and return the new matrix...
}

public int getRows ( ) {
...get number of rows...
}

public int getCols ( ) {
...get number of columns...
}

public void print ( ) {
...print the matrix to stdout...
}

private class ArrayMultiplier extends Thread {
public ArrayMultiplier ( Matrix a, Matrix b, Matrix result, int row, int col ) {
...Construct this bad boy...
}

public void run ( ) {
int sum = 0;
for ( int i = 0; i < a.getCols(); i++ ) {
sum += (a.get(row, i) * b.get(i, col));
}
result.set(row, col, sum);
}

}
}
Now, we want to call this class from Perl. My perferred manner is through SWIG so thats what were going to use. However, you do not need to use SWIG, you can use whatever method you prefer when wrapping C++ classes. We begin by creating a C++ header file from our above class. This is done by using GCJs gcjh utility. First we need to class compile Matrix.java

gcj -C Matrix.java

Then we go ahead and create the header file:

gcjh Matrix

Easy enough. We can then extract the interface we want to have available in Perl from the generated header file and from it create a i file to be used as input to SWIG. I usually start by copying my header file to the same named file but with an i extension instead. I then remove all of the grimy C++ gruff, private methods and variables, slap a module directive on it and call it done. It wont always be this easy though. When youre done an interface file for the above class should look something like this:

%module Matrix;

typedef int jint;

class Matrix
{
public:
Matrix (jint, jint);
virtual void set (jint, jint, jint);
virtual jint get (jint, jint);
virtual ::Matrix *multiply (::Matrix *);
virtual jint getRows ();
virtual jint getCols ();
virtual void print ();
};
We then put SWIG to work and generate our C++ wrapper for Perl:

swig -perl -c++ Matrix.i

After the above command we now will see two new files in our current directory, Matrix.pm and Matrix_wrap.cxx; these correspond the module directive we gave in Matrix.i.

At this point all we have left to do is compile, and use.

gcj -c Matrix.java
gcc -c -I -include Matrix.h Matrix_wrap.cxx
gcc -shared -lgcj -lstdc++ Matrix.o Matrix_wrap.o -oMatrix.so

A simple Perl file using this module might look something like:

sub populate_matrix {
my $matrix = shift;
for ( my $i = 0; $i < $matrix->getRows(); $i++ ) {
for ( my $j = 0; $j < $matrix->getCols(); $j++ ) {
$matrix->set($i, $j, $i * $j);
}
}
}

use GCJ::Cni;
use Matrix;

GCJ::Cni::JvCreateJavaVM(undef);
GCJ::Cni::JvAttachCurrentThread(undef, undef);

my $matrix = new Matrix::Matrix(10, 10);
populate_matrix($matrix);
my $matrix2 = new Matrix::Matrix(10, 10);
populate_matrix($matrix2);
$matrix3 = $matrix->multiply($matrix2);
$matrix3->print();

GCJ::Cni::JvDetachCurrentThread();

Ill leave it up to the reader to write a Perl module that does the same thing, that is, spawns 100 threads. In my own personal fiddling I found that just spawning that many threads (never mind doing any kind of work) was over 3 time slower in Perl. In this situation we at least get to use our favorite language, Perl, and offload some of the heavy hitting to a language more suited for it.

Where this really comes in handy is when you have an existing multi-threaded Java library that you would like to expose to Perl. You could theoretically natively compile various components of your library and then generate Perl bindings to access it. In this way, you get a little extra speed and efficiency as well as code reuse and binding.

<<less
Download (0.020MB)
Added: 2007-06-04 License: Perl Artistic License Price:
877 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5