SlideShare a Scribd company logo
1 of 15
QT
.pro   SQL   
QT                  

QSqlDatabase                       




                                   

                            QODBC
                    SQL Server




                           microsoft


                   QSqlDatabase              




password hostName, databaseName, userName,   

                                             
SQL Server       UDB                   

  DatabaseName     Connection String   




                                       

                                       
QSqlQuery   

QSqlQuery       exec               




                lastError          

QSqlRecord                         

        count                      

    fieldName(int)                 


                                      

next                                  

       value(int)                     




                    NULL              

                           Qvariant   

                                      
preparation          




        QT SQL                             

                          Floating point   

        preparation                        




false                     syntax           




           exec       connection           
placeholder       

           bind Value(QString,QVariant)                 

                                        placeholder
QSqlQuery query;
query.prepare("INSERT INTO Course (id, title, year) "
         "VALUES (:id, :title, :year)");
query.bindValue(":id", 203);
query.bindValue(":title", "Living in America");
query.bindValue(":year", 2002);
query.exec();                                           
Data Model              



                      Data Model                 

              QtSql         QSqlTableModel
                 SQL                             

            (SELECT, INSERT, UPDATE, DELETE)
QListView      GUI                               

                                   QTableView
                            Consol Application
Model.setTable(“ ”)      From

Model.setFilter(“ “)     Where

Model.select(“ “)        select


Select *
From Student
Where Major = „Computer Science‟


          QSqlTableModel::record()
value()                              
   1.Foundation Of
Qt Development
   2.C++ GUI Programming
with Qt 4, Second Edition
Databases in Qt

More Related Content

Viewers also liked

Understanding big data-drupalcamp
Understanding big data-drupalcampUnderstanding big data-drupalcamp
Understanding big data-drupalcampJavier Lafora Rey
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystemFrançois D'Agostini
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0Robert Treat
 
Ruby object model: A matter of life and death
Ruby object model: A matter of life and deathRuby object model: A matter of life and death
Ruby object model: A matter of life and deathJavier Lafora Rey
 
Practical Model View Programming
Practical Model View ProgrammingPractical Model View Programming
Practical Model View ProgrammingMarius Bugge Monsen
 
Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)Marius Bugge Monsen
 
Qt Itemviews, The Next Generation
Qt Itemviews, The Next GenerationQt Itemviews, The Next Generation
Qt Itemviews, The Next GenerationMarius Bugge Monsen
 
API REST for beginners or why you should make your API understandable
API REST for beginners or why you should make your API understandableAPI REST for beginners or why you should make your API understandable
API REST for beginners or why you should make your API understandableJavier Lafora Rey
 
Zackman frame work
Zackman frame workZackman frame work
Zackman frame workganblues
 

Viewers also liked (14)

Understanding big data-drupalcamp
Understanding big data-drupalcampUnderstanding big data-drupalcamp
Understanding big data-drupalcamp
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
 
Linux intro 5 extra: makefiles
Linux intro 5 extra: makefilesLinux intro 5 extra: makefiles
Linux intro 5 extra: makefiles
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
APIs para gente normal
APIs para gente normalAPIs para gente normal
APIs para gente normal
 
Ruby object model: A matter of life and death
Ruby object model: A matter of life and deathRuby object model: A matter of life and death
Ruby object model: A matter of life and death
 
Practical Model View Programming
Practical Model View ProgrammingPractical Model View Programming
Practical Model View Programming
 
Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)Practical Model View Programming (Roadshow Version)
Practical Model View Programming (Roadshow Version)
 
IPC with Qt
IPC with QtIPC with Qt
IPC with Qt
 
Qt Itemviews, The Next Generation
Qt Itemviews, The Next GenerationQt Itemviews, The Next Generation
Qt Itemviews, The Next Generation
 
The Future of Qt Widgets
The Future of Qt WidgetsThe Future of Qt Widgets
The Future of Qt Widgets
 
API REST for beginners or why you should make your API understandable
API REST for beginners or why you should make your API understandableAPI REST for beginners or why you should make your API understandable
API REST for beginners or why you should make your API understandable
 
Zackman frame work
Zackman frame workZackman frame work
Zackman frame work
 

Similar to Databases in Qt

Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Applicationaccount inactive
 
Testowanie JavaScript
Testowanie JavaScriptTestowanie JavaScript
Testowanie JavaScriptTomasz Bak
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platformDeveler S.r.l.
 
Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConqeTimeline, LLC
 
J S B6 Ref Booklet
J S B6 Ref BookletJ S B6 Ref Booklet
J S B6 Ref Booklet51 lecture
 
javascript reference
javascript referencejavascript reference
javascript reference51 lecture
 
Introduction to .Net Driver
Introduction to .Net DriverIntroduction to .Net Driver
Introduction to .Net DriverDataStax Academy
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkZachary Blair
 
Project kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaProject kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaSkills Matter Talks
 
Concat presentation
Concat presentationConcat presentation
Concat presentationRitwik Das
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & WebkitQT-day
 
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperSF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperChester Chen
 
Stream analysis with kafka native way and considerations about monitoring as ...
Stream analysis with kafka native way and considerations about monitoring as ...Stream analysis with kafka native way and considerations about monitoring as ...
Stream analysis with kafka native way and considerations about monitoring as ...Andrew Yongjoon Kong
 
Beyond Map/Reduce: Getting Creative With Parallel Processing
Beyond Map/Reduce: Getting Creative With Parallel ProcessingBeyond Map/Reduce: Getting Creative With Parallel Processing
Beyond Map/Reduce: Getting Creative With Parallel ProcessingEd Kohlwey
 
Using spark 1.2 with Java 8 and Cassandra
Using spark 1.2 with Java 8 and CassandraUsing spark 1.2 with Java 8 and Cassandra
Using spark 1.2 with Java 8 and CassandraDenis Dus
 

Similar to Databases in Qt (20)

Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Application
 
Qt Network Explained (Portuguese)
Qt Network Explained (Portuguese)Qt Network Explained (Portuguese)
Qt Network Explained (Portuguese)
 
Testowanie JavaScript
Testowanie JavaScriptTestowanie JavaScript
Testowanie JavaScript
 
Qt everywhere a c++ abstraction platform
Qt everywhere   a c++ abstraction platformQt everywhere   a c++ abstraction platform
Qt everywhere a c++ abstraction platform
 
04 - Qt Data
04 - Qt Data04 - Qt Data
04 - Qt Data
 
Data Types/Structures in DivConq
Data Types/Structures in DivConqData Types/Structures in DivConq
Data Types/Structures in DivConq
 
Sqlapi0.1
Sqlapi0.1Sqlapi0.1
Sqlapi0.1
 
J S B6 Ref Booklet
J S B6 Ref BookletJ S B6 Ref Booklet
J S B6 Ref Booklet
 
javascript reference
javascript referencejavascript reference
javascript reference
 
Introduction to .Net Driver
Introduction to .Net DriverIntroduction to .Net Driver
Introduction to .Net Driver
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
Lecture17
Lecture17Lecture17
Lecture17
 
A Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application FrameworkA Brief Introduction to the Qt Application Framework
A Brief Introduction to the Qt Application Framework
 
Project kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scalaProject kepler compile time metaprogramming for scala
Project kepler compile time metaprogramming for scala
 
Concat presentation
Concat presentationConcat presentation
Concat presentation
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
 
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperSF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
 
Stream analysis with kafka native way and considerations about monitoring as ...
Stream analysis with kafka native way and considerations about monitoring as ...Stream analysis with kafka native way and considerations about monitoring as ...
Stream analysis with kafka native way and considerations about monitoring as ...
 
Beyond Map/Reduce: Getting Creative With Parallel Processing
Beyond Map/Reduce: Getting Creative With Parallel ProcessingBeyond Map/Reduce: Getting Creative With Parallel Processing
Beyond Map/Reduce: Getting Creative With Parallel Processing
 
Using spark 1.2 with Java 8 and Cassandra
Using spark 1.2 with Java 8 and CassandraUsing spark 1.2 with Java 8 and Cassandra
Using spark 1.2 with Java 8 and Cassandra
 

Recently uploaded

Pros and cons of buying used fleet vehicles.pptx
Pros and cons of buying used fleet vehicles.pptxPros and cons of buying used fleet vehicles.pptx
Pros and cons of buying used fleet vehicles.pptxjennifermiller8137
 
Control-Plan-Training.pptx for the Automotive standard AIAG
Control-Plan-Training.pptx for the Automotive standard AIAGControl-Plan-Training.pptx for the Automotive standard AIAG
Control-Plan-Training.pptx for the Automotive standard AIAGVikrantPawar37
 
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILES
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILESABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILES
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILESsriharshaganjam1
 
Human Resource Practices TATA MOTORS.pdf
Human Resource Practices TATA MOTORS.pdfHuman Resource Practices TATA MOTORS.pdf
Human Resource Practices TATA MOTORS.pdfAditiMishra247289
 
-The-Present-Simple-Tense.pdf english hh
-The-Present-Simple-Tense.pdf english hh-The-Present-Simple-Tense.pdf english hh
-The-Present-Simple-Tense.pdf english hhmhamadhawlery16
 
A Comprehensive Exploration of the Components and Parts Found in Diesel Engines
A Comprehensive Exploration of the Components and Parts Found in Diesel EnginesA Comprehensive Exploration of the Components and Parts Found in Diesel Engines
A Comprehensive Exploration of the Components and Parts Found in Diesel EnginesROJANE BERNAS, PhD.
 
Mastering Mercedes Engine Care Top Tips for Rowlett, TX Residents
Mastering Mercedes Engine Care Top Tips for Rowlett, TX ResidentsMastering Mercedes Engine Care Top Tips for Rowlett, TX Residents
Mastering Mercedes Engine Care Top Tips for Rowlett, TX ResidentsRowlett Motorwerks
 
Lighting the Way Understanding Jaguar Car Check Engine Light Service
Lighting the Way Understanding Jaguar Car Check Engine Light ServiceLighting the Way Understanding Jaguar Car Check Engine Light Service
Lighting the Way Understanding Jaguar Car Check Engine Light ServiceImport Car Center
 
Building a Future Where Everyone Can Ride and Drive Electric by Bridget Gilmore
Building a Future Where Everyone Can Ride and Drive Electric by Bridget GilmoreBuilding a Future Where Everyone Can Ride and Drive Electric by Bridget Gilmore
Building a Future Where Everyone Can Ride and Drive Electric by Bridget GilmoreForth
 
Welcome to Auto Know University Orientation
Welcome to Auto Know University OrientationWelcome to Auto Know University Orientation
Welcome to Auto Know University Orientationxlr8sales
 
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdfkushkruthik555
 
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!Mint Automotive
 

Recently uploaded (12)

Pros and cons of buying used fleet vehicles.pptx
Pros and cons of buying used fleet vehicles.pptxPros and cons of buying used fleet vehicles.pptx
Pros and cons of buying used fleet vehicles.pptx
 
Control-Plan-Training.pptx for the Automotive standard AIAG
Control-Plan-Training.pptx for the Automotive standard AIAGControl-Plan-Training.pptx for the Automotive standard AIAG
Control-Plan-Training.pptx for the Automotive standard AIAG
 
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILES
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILESABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILES
ABOUT REGENERATIVE BRAKING SYSTEM ON AUTOMOBILES
 
Human Resource Practices TATA MOTORS.pdf
Human Resource Practices TATA MOTORS.pdfHuman Resource Practices TATA MOTORS.pdf
Human Resource Practices TATA MOTORS.pdf
 
-The-Present-Simple-Tense.pdf english hh
-The-Present-Simple-Tense.pdf english hh-The-Present-Simple-Tense.pdf english hh
-The-Present-Simple-Tense.pdf english hh
 
A Comprehensive Exploration of the Components and Parts Found in Diesel Engines
A Comprehensive Exploration of the Components and Parts Found in Diesel EnginesA Comprehensive Exploration of the Components and Parts Found in Diesel Engines
A Comprehensive Exploration of the Components and Parts Found in Diesel Engines
 
Mastering Mercedes Engine Care Top Tips for Rowlett, TX Residents
Mastering Mercedes Engine Care Top Tips for Rowlett, TX ResidentsMastering Mercedes Engine Care Top Tips for Rowlett, TX Residents
Mastering Mercedes Engine Care Top Tips for Rowlett, TX Residents
 
Lighting the Way Understanding Jaguar Car Check Engine Light Service
Lighting the Way Understanding Jaguar Car Check Engine Light ServiceLighting the Way Understanding Jaguar Car Check Engine Light Service
Lighting the Way Understanding Jaguar Car Check Engine Light Service
 
Building a Future Where Everyone Can Ride and Drive Electric by Bridget Gilmore
Building a Future Where Everyone Can Ride and Drive Electric by Bridget GilmoreBuilding a Future Where Everyone Can Ride and Drive Electric by Bridget Gilmore
Building a Future Where Everyone Can Ride and Drive Electric by Bridget Gilmore
 
Welcome to Auto Know University Orientation
Welcome to Auto Know University OrientationWelcome to Auto Know University Orientation
Welcome to Auto Know University Orientation
 
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf
248649330-Animatronics-Technical-Seminar-Report-by-Aswin-Sarang.pdf
 
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!
Can't Roll Up Your Audi A4 Power Window Let's Uncover the Issue!
 

Databases in Qt

  • 1. QT
  • 2. .pro SQL 
  • 3. QT  QSqlDatabase   QODBC SQL Server microsoft
  • 4. QSqlDatabase  password hostName, databaseName, userName,  
  • 5. SQL Server UDB  DatabaseName Connection String   
  • 6. QSqlQuery  QSqlQuery exec  lastError  QSqlRecord  count  fieldName(int) 
  • 7.  next  value(int)  NULL  Qvariant  
  • 8. preparation  QT SQL  Floating point  preparation  false syntax  exec connection 
  • 9. placeholder  bind Value(QString,QVariant)  placeholder QSqlQuery query; query.prepare("INSERT INTO Course (id, title, year) " "VALUES (:id, :title, :year)"); query.bindValue(":id", 203); query.bindValue(":title", "Living in America"); query.bindValue(":year", 2002); query.exec(); 
  • 10. Data Model  Data Model  QtSql QSqlTableModel SQL  (SELECT, INSERT, UPDATE, DELETE) QListView GUI  QTableView Consol Application
  • 11. Model.setTable(“ ”) From Model.setFilter(“ “) Where Model.select(“ “) select Select * From Student Where Major = „Computer Science‟
  • 12. QSqlTableModel::record() value() 
  • 13. 1.Foundation Of Qt Development
  • 14. 2.C++ GUI Programming with Qt 4, Second Edition

Editor's Notes

  1. Whats qt:Libraries for C++ lanquageOpen source Using implemented classesUsing Qt Creator IDE