summaryrefslogtreecommitdiffstats
path: root/examples/sql
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-03-02 02:11:59 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-03-02 02:11:59 -0600
commit9a75b154bf0732aa3a501b6e31e566e06c5f8a31 (patch)
treedf1e10cc7504665622d096f9ba80dc9e56f3afb8 /examples/sql
parenta830bf10b7d4ed2c83ffe68c0b22d7c4ba9860b0 (diff)
downloadqt3-9a75b154bf0732aa3a501b6e31e566e06c5f8a31.tar.gz
qt3-9a75b154bf0732aa3a501b6e31e566e06c5f8a31.zip
Undo prior accidental commit
Diffstat (limited to 'examples/sql')
-rw-r--r--examples/sql/blob/main.cpp34
-rw-r--r--examples/sql/overview/connection.cpp4
-rw-r--r--examples/sql/overview/extract/main.cpp2
-rw-r--r--examples/sql/overview/order1/main.cpp2
-rw-r--r--examples/sql/overview/order2/main.cpp2
-rw-r--r--examples/sql/overview/retrieve1/main.cpp2
-rw-r--r--examples/sql/overview/retrieve2/main.cpp2
7 files changed, 24 insertions, 24 deletions
diff --git a/examples/sql/blob/main.cpp b/examples/sql/blob/main.cpp
index c6ce4d9..054d857 100644
--- a/examples/sql/blob/main.cpp
+++ b/examples/sql/blob/main.cpp
@@ -29,52 +29,52 @@ int main( int argc, char ** argv )
db->setPassword( PASSWORD );
db->setHostName( HOST );
if ( !db->open() ) {
- tqWarning( db->lastError().databaseText() );
+ qWarning( db->lastError().databaseText() );
return 1;
}
if ( argc < 2 ) {
- tqWarning( "Usage: %s <filename>", argv[0] );
+ qWarning( "Usage: %s <filename>", argv[0] );
return 1;
}
// read a file which we want to insert into the database
QFile f( argv[1] );
if ( !f.open( IO_ReadOnly ) ) {
- tqWarning( "Unable to open data file '%s' - exiting", argv[1] );
+ qWarning( "Unable to open data file '%s' - exiting", argv[1] );
return 1;
}
QByteArray binaryData = f.readAll();
- tqWarning( "Data size: %d", binaryData.size() );
+ qWarning( "Data size: %d", binaryData.size() );
// create a table with a binary field
QSqlQuery q;
if ( !q.exec( "CREATE TABLE blobexample ( id INT PRIMARY KEY, binfield LONGBLOB )" ) ) {
- tqWarning( "Unable to create table - exiting" );
+ qWarning( "Unable to create table - exiting" );
return 1;
}
// insert a BLOB into the table
if ( !q.prepare( "INSERT INTO blobexample ( id, binfield ) VALUES ( ?, ? )" ) ) {
- tqWarning( "Unable to prepare query - exiting" );
+ qWarning( "Unable to prepare query - exiting" );
return 1;
}
q.bindValue( 0, 1 );
q.bindValue( 1, binaryData );
if ( !q.exec() ) {
- tqWarning( "Unable to execute prepared query - exiting" );
+ qWarning( "Unable to execute prepared query - exiting" );
return 1;
}
// read the BLOB back from the database
if ( !q.exec( "SELECT id, binfield FROM blobexample" ) ) {
- tqWarning( "Unable to execute query - exiting" );
+ qWarning( "Unable to execute query - exiting" );
return 1;
}
- tqWarning( "\nQSqlQuery:" );
+ qWarning( "\nQSqlQuery:" );
while ( q.next() ) {
- tqWarning( "BLOB id: %d", q.value( 0 ).toInt() );
- tqWarning( "BLOB size: %d", q.value( 1 ).toByteArray().size() );
+ qWarning( "BLOB id: %d", q.value( 0 ).toInt() );
+ qWarning( "BLOB size: %d", q.value( 1 ).toByteArray().size() );
}
// write another BLOB using QSqlCursor
@@ -83,23 +83,23 @@ int main( int argc, char ** argv )
r->setValue( "id", 2 );
r->setValue( "binfield", binaryData );
if ( !cur.insert() ) {
- tqWarning( "Unable to insert BLOB using QSqlCursor - exiting" );
+ qWarning( "Unable to insert BLOB using QSqlCursor - exiting" );
return 1;
}
// read the BLOBs back using QSqlCursor
if ( !cur.select() ) {
- tqWarning( "Unable retrieve blobexample table using QSqlCursor - exiting" );
+ qWarning( "Unable retrieve blobexample table using QSqlCursor - exiting" );
return 1;
}
- tqWarning( "\nQSqlCursor:" );
+ qWarning( "\nQSqlCursor:" );
while ( cur.next() ) {
- tqWarning( "BLOB id: %d", cur.value( "id" ).toInt() );
- tqWarning( "BLOB size: %d", cur.value( "binfield" ).toByteArray().size() );
+ qWarning( "BLOB id: %d", cur.value( "id" ).toInt() );
+ qWarning( "BLOB size: %d", cur.value( "binfield" ).toByteArray().size() );
}
if ( !q.exec( "DROP TABLE blobexample" ) ) {
- tqWarning( "Unable to drop table - exiting" );
+ qWarning( "Unable to drop table - exiting" );
return 1;
}
return 0;
diff --git a/examples/sql/overview/connection.cpp b/examples/sql/overview/connection.cpp
index e096204..6afaa53 100644
--- a/examples/sql/overview/connection.cpp
+++ b/examples/sql/overview/connection.cpp
@@ -18,7 +18,7 @@ bool createConnections()
defaultDB->setPassword( DB_SALES_PASSWD );
defaultDB->setHostName( DB_SALES_HOST );
if ( ! defaultDB->open() ) {
- tqWarning( "Failed to open sales database: " + defaultDB->lastError().text() );
+ qWarning( "Failed to open sales database: " + defaultDB->lastError().text() );
return FALSE;
}
@@ -28,7 +28,7 @@ bool createConnections()
oracle->setPassword( DB_ORDERS_PASSWD );
oracle->setHostName( DB_ORDERS_HOST );
if ( ! oracle->open() ) {
- tqWarning( "Failed to open orders database: " + oracle->lastError().text() );
+ qWarning( "Failed to open orders database: " + oracle->lastError().text() );
return FALSE;
}
diff --git a/examples/sql/overview/extract/main.cpp b/examples/sql/overview/extract/main.cpp
index d3dd194..3714c1a 100644
--- a/examples/sql/overview/extract/main.cpp
+++ b/examples/sql/overview/extract/main.cpp
@@ -33,7 +33,7 @@ int main( int argc, char *argv[] )
int id = cur.value( "id" ).toInt();
QString name = cur.value( "forename" ).toString() + " " +
cur.value( "surname" ).toString();
- tqDebug( QString::number( id ) + ": " + name );
+ qDebug( QString::number( id ) + ": " + name );
}
}
diff --git a/examples/sql/overview/order1/main.cpp b/examples/sql/overview/order1/main.cpp
index 3d9b129..3d64748 100644
--- a/examples/sql/overview/order1/main.cpp
+++ b/examples/sql/overview/order1/main.cpp
@@ -22,7 +22,7 @@ int main( int argc, char *argv[] )
QSqlIndex order = cur.index( fields );
cur.select( order );
while ( cur.next() ) {
- tqDebug( cur.value( "id" ).toString() + ": " +
+ qDebug( cur.value( "id" ).toString() + ": " +
cur.value( "surname" ).toString() + " " +
cur.value( "forename" ).toString() );
}
diff --git a/examples/sql/overview/order2/main.cpp b/examples/sql/overview/order2/main.cpp
index 43ae7a2..762562e 100644
--- a/examples/sql/overview/order2/main.cpp
+++ b/examples/sql/overview/order2/main.cpp
@@ -24,7 +24,7 @@ int main( int argc, char *argv[] )
cur.setValue( "surname", "Bloggs" );
cur.select( filter, order );
while ( cur.next() ) {
- tqDebug( cur.value( "id" ).toString() + ": " +
+ qDebug( cur.value( "id" ).toString() + ": " +
cur.value( "surname" ).toString() + " " +
cur.value( "forename" ).toString() );
}
diff --git a/examples/sql/overview/retrieve1/main.cpp b/examples/sql/overview/retrieve1/main.cpp
index 6b9f303..b1cc06b 100644
--- a/examples/sql/overview/retrieve1/main.cpp
+++ b/examples/sql/overview/retrieve1/main.cpp
@@ -20,7 +20,7 @@ int main( int argc, char *argv[] )
QSqlQuery query( "SELECT id, surname FROM staff" );
if ( query.isActive() ) {
while ( query.next() ) {
- tqDebug( query.value(0).toString() + ": " +
+ qDebug( query.value(0).toString() + ": " +
query.value(1).toString() );
}
}
diff --git a/examples/sql/overview/retrieve2/main.cpp b/examples/sql/overview/retrieve2/main.cpp
index 0821265..69b172b 100644
--- a/examples/sql/overview/retrieve2/main.cpp
+++ b/examples/sql/overview/retrieve2/main.cpp
@@ -20,7 +20,7 @@ int main( int argc, char *argv[] )
QSqlCursor cur( "staff" ); // Specify the table/view name
cur.select(); // We'll retrieve every record
while ( cur.next() ) {
- tqDebug( cur.value( "id" ).toString() + ": " +
+ qDebug( cur.value( "id" ).toString() + ": " +
cur.value( "surname" ).toString() + " " +
cur.value( "salary" ).toString() );
}