Diffstat (limited to 'libopie2/examples/opiedb/sqltest') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opiedb/sqltest/spaltenweise.cpp | 10 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/spaltenweise.pro | 2 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.cpp | 10 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.pro | 2 |
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,41 +1,43 @@ | |||
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 | |||
9 | using namespace Opie::DB; | ||
8 | 10 | ||
9 | int main( int argc, char* argv[] ) { | 11 | int 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++ ) { |
32 | int uid = i; | 34 | int uid = i; |
33 | OSQLRawQuery raw("insert into todolist VALUES("+ | 35 | OSQLRawQuery raw("insert into todolist VALUES("+ |
34 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ | 36 | QString::number(uid)+ ",'-122324;-12132',1,100,"+ |
35 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ | 37 | "'Summary234-"+QString::number(uid)+"',1,5,8,2002,1,"+ |
36 | "'Description\n12344')"); | 38 | "'Description\n12344')"); |
37 | OSQLResult res = driver->query( &raw ); | 39 | OSQLResult res = driver->query( &raw ); |
38 | 40 | ||
39 | } | 41 | } |
40 | return 0; | 42 | return 0; |
41 | }; | 43 | }; |
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 |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
7 | LIBS += -lqpe -lopiesql | 7 | LIBS += -lqpe -lopiedb2 |
8 | TARGET = spaltenweise | 8 | TARGET = spaltenweise |
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | include ( $(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,55 +1,57 @@ | |||
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 | |||
9 | using namespace Opie::DB; | ||
8 | 10 | ||
9 | int main( int argc, char* argv[] ) { | 11 | int 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/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')"); |
32 | OSQLResult res = driver->query(raw ); | 34 | OSQLResult res = driver->query(raw ); |
33 | delete raw; | 35 | delete raw; |
34 | 36 | ||
35 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + | 37 | raw = new OSQLRawQuery("insert into todolist VALUES("+QString::number(uid) + |
36 | ",'Completed',1)" ); | 38 | ",'Completed',1)" ); |
37 | res = driver->query(raw ); | 39 | res = driver->query(raw ); |
38 | delete raw; | 40 | delete raw; |
39 | 41 | ||
40 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 42 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
41 | QString::number(uid)+",'Progress',100)" ); | 43 | QString::number(uid)+",'Progress',100)" ); |
42 | res = driver->query( raw ); | 44 | res = driver->query( raw ); |
43 | delete raw; | 45 | delete raw; |
44 | 46 | ||
45 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 47 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
46 | QString::number(uid)+",'Summary',"+ | 48 | QString::number(uid)+",'Summary',"+ |
47 | "'Summary234-"+ QString::number(uid) + "')"); | 49 | "'Summary234-"+ QString::number(uid) + "')"); |
48 | res = driver->query( raw ); | 50 | res = driver->query( raw ); |
49 | delete raw; | 51 | delete raw; |
50 | 52 | ||
51 | raw = new OSQLRawQuery("insert into todolist VALUES("+ | 53 | raw = new OSQLRawQuery("insert into todolist VALUES("+ |
52 | QString::number(uid)+",'HasDate',1)"); | 54 | QString::number(uid)+",'HasDate',1)"); |
53 | res = driver->query( raw ); | 55 | res = driver->query( raw ); |
54 | delete raw; | 56 | delete raw; |
55 | 57 | ||
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 |
5 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
6 | DEPENDPATH+= $(OPIEDIR)/include | 6 | DEPENDPATH+= $(OPIEDIR)/include |
7 | LIBS += -lqpe -lopiesql | 7 | LIBS += -lqpe -lopiedb2 |
8 | TARGET = zeilenweise | 8 | TARGET = zeilenweise |
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | include ( $(OPIEDIR)/include.pro ) | 13 | include ( $(OPIEDIR)/include.pro ) |