summaryrefslogtreecommitdiff
path: root/libopie2/examples/opiedb/sqltest
Unidiff
Diffstat (limited to 'libopie2/examples/opiedb/sqltest') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/spaltenweise.pro2
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.cpp10
-rw-r--r--libopie2/examples/opiedb/sqltest/zeilenweise.pro2
4 files changed, 14 insertions, 10 deletions
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
index 8790cdd..e1a4d5d 100644
--- a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
+++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp
@@ -1,31 +1,33 @@
1#include <qdir.h> 1#include <qdir.h>
2 2
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include "../osqlmanager.h" 4#include <opie2/osqlmanager.h>
5#include "../osqlquery.h" 5#include <opie2/osqlquery.h>
6#include "../osqldriver.h" 6#include <opie2/osqldriver.h>
7#include "../osqlresult.h" 7#include <opie2/osqlresult.h>
8
9using namespace Opie::DB;
8 10
9int main( int argc, char* argv[] ) { 11int main( int argc, char* argv[] ) {
10 12
11 QPEApplication app( argc, argv ); 13 QPEApplication app( argc, argv );
12 OSQLManager man; 14 OSQLManager man;
13 man.registerPath( QDir::currentDirPath() ); 15 man.registerPath( QDir::currentDirPath() );
14 OSQLBackEnd::ValueList list = man.queryBackEnd(); 16 OSQLBackEnd::ValueList list = man.queryBackEnd();
15 17
16 OSQLDriver *driver = man.standard(); 18 OSQLDriver *driver = man.standard();
17 qWarning("testmain" + driver->id() ); 19 qWarning("testmain" + driver->id() );
18 driver->setUrl("/home/ich/spaltenweise"); 20 driver->setUrl("/home/ich/spaltenweise");
19 if ( driver->open() ) { 21 if ( driver->open() ) {
20 qWarning("could open"); 22 qWarning("could open");
21 }else 23 }else
22 qWarning("wasn't able to open"); 24 qWarning("wasn't able to open");
23 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" 25 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist("
24 "uid,categories,completed," 26 "uid,categories,completed,"
25 "progress,summary,HasDate," 27 "progress,summary,HasDate,"
26 "DateDay,DateMonth,DateYear," 28 "DateDay,DateMonth,DateYear,"
27 "priority,description)" ); 29 "priority,description)" );
28 30
29 OSQLResult res = driver->query( raw ); 31 OSQLResult res = driver->query( raw );
30 delete raw; 32 delete raw;
31 for (int i = 0; i< 10000; i++ ) { 33 for (int i = 0; i< 10000; i++ ) {
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.pro b/libopie2/examples/opiedb/sqltest/spaltenweise.pro
index f54fada..3cab802 100644
--- a/libopie2/examples/opiedb/sqltest/spaltenweise.pro
+++ b/libopie2/examples/opiedb/sqltest/spaltenweise.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = 3 HEADERS =
4 SOURCES = spaltenweise.cpp 4 SOURCES = spaltenweise.cpp
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 6 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiesql 7LIBS += -lqpe -lopiedb2
8 TARGET = spaltenweise 8 TARGET = spaltenweise
9 9
10 10
11 11
12 12
13include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
index e538c9f..2d11ac5 100644
--- a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
+++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp
@@ -1,31 +1,33 @@
1#include <qdir.h> 1#include <qdir.h>
2 2
3#include <qpe/qpeapplication.h> 3#include <qpe/qpeapplication.h>
4#include "../osqlmanager.h" 4#include <opie2/osqlmanager.h>
5#include "../osqlquery.h" 5#include <opie2/osqlquery.h>
6#include "../osqldriver.h" 6#include <opie2/osqldriver.h>
7#include "../osqlresult.h" 7#include <opie2/osqlresult.h>
8
9using namespace Opie::DB;
8 10
9int main( int argc, char* argv[] ) { 11int main( int argc, char* argv[] ) {
10 12
11QPEApplication app( argc, argv ); 13QPEApplication app( argc, argv );
12OSQLManager man; 14OSQLManager man;
13man.registerPath( QDir::currentDirPath() ); 15man.registerPath( QDir::currentDirPath() );
14OSQLBackEnd::ValueList list = man.queryBackEnd(); 16OSQLBackEnd::ValueList list = man.queryBackEnd();
15 17
16OSQLDriver *driver = man.standard(); 18OSQLDriver *driver = man.standard();
17 qWarning("testmain" + driver->id() ); 19 qWarning("testmain" + driver->id() );
18 driver->setUrl("/home/ich/zeilenweise"); 20 driver->setUrl("/home/ich/zeilenweise");
19 if ( driver->open() ) { 21 if ( driver->open() ) {
20 qWarning("could open"); 22 qWarning("could open");
21 }else 23 }else
22 qWarning("wasn't able to open"); 24 qWarning("wasn't able to open");
23 OSQLRawQuery raw2("BEGIN TRANSACTION"); 25 OSQLRawQuery raw2("BEGIN TRANSACTION");
24 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); 26 OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)");
25 OSQLResult res = driver->query( &raw2 ); 27 OSQLResult res = driver->query( &raw2 );
26 res = driver->query( raw ); 28 res = driver->query( raw );
27 delete raw; 29 delete raw;
28 for (int i = 0; i< 10000; i++ ) { 30 for (int i = 0; i< 10000; i++ ) {
29 int uid = i; 31 int uid = i;
30 OSQLRawQuery *raw; 32 OSQLRawQuery *raw;
31 raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')"); 33 raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid)+",'Categories',"+"'-122324;-12132')");
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.pro b/libopie2/examples/opiedb/sqltest/zeilenweise.pro
index e5cfcc7..6952921 100644
--- a/libopie2/examples/opiedb/sqltest/zeilenweise.pro
+++ b/libopie2/examples/opiedb/sqltest/zeilenweise.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 HEADERS = 3 HEADERS =
4 SOURCES = zeilenweise.cpp 4 SOURCES = zeilenweise.cpp
5INCLUDEPATH += $(OPIEDIR)/include 5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= $(OPIEDIR)/include 6 DEPENDPATH+= $(OPIEDIR)/include
7LIBS += -lqpe -lopiesql 7LIBS += -lqpe -lopiedb2
8 TARGET = zeilenweise 8 TARGET = zeilenweise
9 9
10 10
11 11
12 12
13include ( $(OPIEDIR)/include.pro ) 13include ( $(OPIEDIR)/include.pro )