Diffstat (limited to 'libopie2/examples/opiedb/sqltest/zeilenweise.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 | |||
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')"); |