Diffstat (limited to 'libopie2/examples/opiedb/sqltest') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/examples/opiedb/sqltest/main.cpp | 42 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/spaltenweise.cpp | 6 | ||||
-rw-r--r-- | libopie2/examples/opiedb/sqltest/zeilenweise.cpp | 6 |
3 files changed, 43 insertions, 11 deletions
diff --git a/libopie2/examples/opiedb/sqltest/main.cpp b/libopie2/examples/opiedb/sqltest/main.cpp index adca5fd..24b7b21 100644 --- a/libopie2/examples/opiedb/sqltest/main.cpp +++ b/libopie2/examples/opiedb/sqltest/main.cpp | |||
@@ -1,29 +1,61 @@ | |||
1 | #include <qdir.h> | 1 | /* |
2 | =. This file is part of the Opie Project | ||
3 | .=l. Copyright (C) 2004 Opie Team <opie@handhelds.org> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This library is free software; you can | ||
6 | .> <`_, > . <= redistribute it and/or modify it under | ||
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This library is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
17 | ..}^=.= = ; Library General Public License for more | ||
18 | ++= -. .` .: details. | ||
19 | : = ...= . :.=- | ||
20 | -. .:....=;==+<; You should have received a copy of the GNU | ||
21 | -_. . . )=. = Library General Public License along with | ||
22 | -- :-=` this library; see the file COPYING.LIB. | ||
23 | If not, write to the Free Software Foundation, | ||
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
2 | 26 | ||
3 | #include <qpe/qpeapplication.h> | 27 | */ |
28 | |||
29 | /* OPIE */ | ||
4 | #include <opie2/osqlmanager.h> | 30 | #include <opie2/osqlmanager.h> |
5 | #include <opie2/osqlquery.h> | 31 | #include <opie2/osqlquery.h> |
6 | #include <opie2/osqldriver.h> | 32 | #include <opie2/osqldriver.h> |
7 | #include <opie2/osqlresult.h> | 33 | #include <opie2/osqlresult.h> |
34 | #include <opie2/odebug.h> | ||
35 | |||
36 | #include <qpe/qpeapplication.h> | ||
37 | |||
38 | /* QT */ | ||
39 | #include <qdir.h> | ||
8 | 40 | ||
9 | using namespace Opie::DB; | 41 | using namespace Opie::DB; |
10 | int main( int argc, char* argv[] ) { | 42 | int main( int argc, char* argv[] ) { |
11 | 43 | ||
12 | QPEApplication app( argc, argv ); | 44 | QPEApplication app( argc, argv ); |
13 | OSQLManager man; | 45 | OSQLManager man; |
14 | man.registerPath( QDir::currentDirPath() ); | 46 | man.registerPath( QDir::currentDirPath() ); |
15 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 47 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
16 | 48 | ||
17 | OSQLDriver *driver = man.standard(); | 49 | OSQLDriver *driver = man.standard(); |
18 | qWarning("testmain" + driver->id() ); | 50 | owarn << "testmain" + driver->id() << oendl; |
19 | driver->setUrl("/home/ich/test2vhgytry"); | 51 | driver->setUrl("/home/ich/test2vhgytry"); |
20 | if ( driver->open() ) { | 52 | if ( driver->open() ) { |
21 | qWarning("could open"); | 53 | owarn << "could open" << oendl; |
22 | }else | 54 | }else |
23 | qWarning("wasn't able to open"); | 55 | owarn << "wasn't able to open" << oendl; |
24 | OSQLRawQuery raw("select * from t2" ); | 56 | OSQLRawQuery raw("select * from t2" ); |
25 | OSQLResult res = driver->query( &raw ); | 57 | OSQLResult res = driver->query( &raw ); |
26 | 58 | ||
27 | OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); | 59 | OSQLRawQuery raw2( "insert into t2 VALUES(ROWID,'Meine Mutter') "); |
28 | res = driver->query(&raw2); | 60 | res = driver->query(&raw2); |
29 | 61 | ||
diff --git a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp index e1a4d5d..c11724c 100644 --- a/libopie2/examples/opiedb/sqltest/spaltenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/spaltenweise.cpp | |||
@@ -13,18 +13,18 @@ int main( int argc, char* argv[] ) { | |||
13 | QPEApplication app( argc, argv ); | 13 | QPEApplication app( argc, argv ); |
14 | OSQLManager man; | 14 | OSQLManager man; |
15 | man.registerPath( QDir::currentDirPath() ); | 15 | man.registerPath( QDir::currentDirPath() ); |
16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
17 | 17 | ||
18 | OSQLDriver *driver = man.standard(); | 18 | OSQLDriver *driver = man.standard(); |
19 | qWarning("testmain" + driver->id() ); | 19 | owarn << "testmain" + driver->id() << oendl; |
20 | driver->setUrl("/home/ich/spaltenweise"); | 20 | driver->setUrl("/home/ich/spaltenweise"); |
21 | if ( driver->open() ) { | 21 | if ( driver->open() ) { |
22 | qWarning("could open"); | 22 | owarn << "could open" << oendl; |
23 | }else | 23 | }else |
24 | qWarning("wasn't able to open"); | 24 | owarn << "wasn't able to open" << oendl; |
25 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" | 25 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(" |
26 | "uid,categories,completed," | 26 | "uid,categories,completed," |
27 | "progress,summary,HasDate," | 27 | "progress,summary,HasDate," |
28 | "DateDay,DateMonth,DateYear," | 28 | "DateDay,DateMonth,DateYear," |
29 | "priority,description)" ); | 29 | "priority,description)" ); |
30 | 30 | ||
diff --git a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp index 2d11ac5..126e797 100644 --- a/libopie2/examples/opiedb/sqltest/zeilenweise.cpp +++ b/libopie2/examples/opiedb/sqltest/zeilenweise.cpp | |||
@@ -13,18 +13,18 @@ int main( int argc, char* argv[] ) { | |||
13 | QPEApplication app( argc, argv ); | 13 | QPEApplication app( argc, argv ); |
14 | OSQLManager man; | 14 | OSQLManager man; |
15 | man.registerPath( QDir::currentDirPath() ); | 15 | man.registerPath( QDir::currentDirPath() ); |
16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); | 16 | OSQLBackEnd::ValueList list = man.queryBackEnd(); |
17 | 17 | ||
18 | OSQLDriver *driver = man.standard(); | 18 | OSQLDriver *driver = man.standard(); |
19 | qWarning("testmain" + driver->id() ); | 19 | owarn << "testmain" + driver->id() << oendl; |
20 | driver->setUrl("/home/ich/zeilenweise"); | 20 | driver->setUrl("/home/ich/zeilenweise"); |
21 | if ( driver->open() ) { | 21 | if ( driver->open() ) { |
22 | qWarning("could open"); | 22 | owarn << "could open" << oendl; |
23 | }else | 23 | }else |
24 | qWarning("wasn't able to open"); | 24 | owarn << "wasn't able to open" << oendl; |
25 | OSQLRawQuery raw2("BEGIN TRANSACTION"); | 25 | OSQLRawQuery raw2("BEGIN TRANSACTION"); |
26 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); | 26 | OSQLRawQuery *raw = new OSQLRawQuery("create table todolist(uid,key,value)"); |
27 | OSQLResult res = driver->query( &raw2 ); | 27 | OSQLResult res = driver->query( &raw2 ); |
28 | res = driver->query( raw ); | 28 | res = driver->query( raw ); |
29 | delete raw; | 29 | delete raw; |
30 | for (int i = 0; i< 10000; i++ ) { | 30 | for (int i = 0; i< 10000; i++ ) { |