summaryrefslogtreecommitdiffstats
path: root/examples/sql
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-28 22:31:39 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-02-28 22:31:39 -0600
commit41bb408dde90e755b07cd2ab8a9bdec7548c84b0 (patch)
tree6d4d5407c000add30aa78630e009c0e5d633e440 /examples/sql
parent1740cd279522c060e738bbbffacab83355d2b794 (diff)
downloadtqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.tar.gz
tqt3-41bb408dde90e755b07cd2ab8a9bdec7548c84b0.zip
Automated conversion from qt3
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 524ecd9c8..9bb9ea0c4 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() ) {
- qWarning( db->lastError().databaseText() );
+ tqWarning( db->lastError().databaseText() );
return 1;
}
if ( argc < 2 ) {
- qWarning( "Usage: %s <filename>", argv[0] );
+ tqWarning( "Usage: %s <filename>", argv[0] );
return 1;
}
// read a file which we want to insert into the database
TQFile f( argv[1] );
if ( !f.open( IO_ReadOnly ) ) {
- qWarning( "Unable to open data file '%s' - exiting", argv[1] );
+ tqWarning( "Unable to open data file '%s' - exiting", argv[1] );
return 1;
}
TQByteArray binaryData = f.readAll();
- qWarning( "Data size: %d", binaryData.size() );
+ tqWarning( "Data size: %d", binaryData.size() );
// create a table with a binary field
TQSqlQuery q;
if ( !q.exec( "CREATE TABLE blobexample ( id INT PRIMARY KEY, binfield LONGBLOB )" ) ) {
- qWarning( "Unable to create table - exiting" );
+ tqWarning( "Unable to create table - exiting" );
return 1;
}
// insert a BLOB into the table
if ( !q.prepare( "INSERT INTO blobexample ( id, binfield ) VALUES ( ?, ? )" ) ) {
- qWarning( "Unable to prepare query - exiting" );
+ tqWarning( "Unable to prepare query - exiting" );
return 1;
}
q.bindValue( 0, 1 );
q.bindValue( 1, binaryData );
if ( !q.exec() ) {
- qWarning( "Unable to execute prepared query - exiting" );
+ tqWarning( "Unable to execute prepared query - exiting" );
return 1;
}
// read the BLOB back from the database
if ( !q.exec( "SELECT id, binfield FROM blobexample" ) ) {
- qWarning( "Unable to execute query - exiting" );
+ tqWarning( "Unable to execute query - exiting" );
return 1;
}
- qWarning( "\nTQSqlQuery:" );
+ tqWarning( "\nTQSqlQuery:" );
while ( q.next() ) {
- qWarning( "BLOB id: %d", q.value( 0 ).toInt() );
- qWarning( "BLOB size: %d", q.value( 1 ).toByteArray().size() );
+ tqWarning( "BLOB id: %d", q.value( 0 ).toInt() );
+ tqWarning( "BLOB size: %d", q.value( 1 ).toByteArray().size() );
}
// write another BLOB using TQSqlCursor
@@ -83,23 +83,23 @@ int main( int argc, char ** argv )
r->setValue( "id", 2 );
r->setValue( "binfield", binaryData );
if ( !cur.insert() ) {
- qWarning( "Unable to insert BLOB using TQSqlCursor - exiting" );
+ tqWarning( "Unable to insert BLOB using TQSqlCursor - exiting" );
return 1;
}
// read the BLOBs back using TQSqlCursor
if ( !cur.select() ) {
- qWarning( "Unable retrieve blobexample table using TQSqlCursor - exiting" );
+ tqWarning( "Unable retrieve blobexample table using TQSqlCursor - exiting" );
return 1;
}
- qWarning( "\nTQSqlCursor:" );
+ tqWarning( "\nTQSqlCursor:" );
while ( cur.next() ) {
- qWarning( "BLOB id: %d", cur.value( "id" ).toInt() );
- qWarning( "BLOB size: %d", cur.value( "binfield" ).toByteArray().size() );
+ tqWarning( "BLOB id: %d", cur.value( "id" ).toInt() );
+ tqWarning( "BLOB size: %d", cur.value( "binfield" ).toByteArray().size() );
}
if ( !q.exec( "DROP TABLE blobexample" ) ) {
- qWarning( "Unable to drop table - exiting" );
+ tqWarning( "Unable to drop table - exiting" );
return 1;
}
return 0;
diff --git a/examples/sql/overview/connection.cpp b/examples/sql/overview/connection.cpp
index ee49b1a2a..bb8654df1 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() ) {
- qWarning( "Failed to open sales database: " + defaultDB->lastError().text() );
+ tqWarning( "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() ) {
- qWarning( "Failed to open orders database: " + oracle->lastError().text() );
+ tqWarning( "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 8a6606d21..0c47911ce 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();
TQString name = cur.value( "forename" ).toString() + " " +
cur.value( "surname" ).toString();
- qDebug( TQString::number( id ) + ": " + name );
+ tqDebug( TQString::number( id ) + ": " + name );
}
}
diff --git a/examples/sql/overview/order1/main.cpp b/examples/sql/overview/order1/main.cpp
index 89d7658de..8c2c48df3 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[] )
TQSqlIndex order = cur.index( fields );
cur.select( order );
while ( cur.next() ) {
- qDebug( cur.value( "id" ).toString() + ": " +
+ tqDebug( 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 2dfba8315..09c36151b 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() ) {
- qDebug( cur.value( "id" ).toString() + ": " +
+ tqDebug( 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 1b7e11778..768f870de 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[] )
TQSqlQuery query( "SELECT id, surname FROM staff" );
if ( query.isActive() ) {
while ( query.next() ) {
- qDebug( query.value(0).toString() + ": " +
+ tqDebug( 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 ecb59296e..71079e5ee 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[] )
TQSqlCursor cur( "staff" ); // Specify the table/view name
cur.select(); // We'll retrieve every record
while ( cur.next() ) {
- qDebug( cur.value( "id" ).toString() + ": " +
+ tqDebug( cur.value( "id" ).toString() + ": " +
cur.value( "surname" ).toString() + " " +
cur.value( "salary" ).toString() );
}