Giter VIP home page Giter VIP logo

qt-sql-example's Introduction

Qt SQL Example

An exemplary Qt app that connects to SQL server and displays a table from a database. The program was made for educational purposes.

Compiled Windows and Linux applications with statically-linked libraries can be downloaded from Releases.

The application is developed with Qt 5.9.1 on Windows 10 and Ubuntu 16.04. The program was tested on MySQL Server 5.5.57 and Microsoft SQL Server 2008 R2 SP3.

Client config

The program reads config.ini on startup. The file must be in the app working directory.

SQL database drivers

A comprehensive discussion about SQL database drivers (Qt driver plugins as well as system drivers) can be found in Qt Documentation. MSSQL is handled by the ODBC driver.

Although binaries of the program have statically-linked libraries, in order to connect from Linux to MSSQL server, one should install ODBC SQL Server driver (e.g. msodbcsql17*).

The following section covers the essential tools to develop app with dynamically-linked SQL libraries.

Windows 10

  • Both Qt SQL driver plugins (QMYSQL and QODBC) should be already bundled with Qt SDK.
  • MySQL driver can be installed by placing libmysql.dll from C API for MySQL (mysqlclient) in the app working directory.
  • ODBC Driver Manager and SQL Server driver are built in; hence, no further installation is necessary. Alternatively, instead of SQL Server driver, one can use Microsoft ODBC Driver; see Microsoft Docs.

Ubuntu 16.04

Packages with Qt driver plugins and system SQL drivers:

  • MySQL - libqt5sql5-mysql libmysqlclient20,
  • ODBC (unixODBC Driver Manager and Microsoft ODBC Driver) - libqt5sql5-odbc libodbc1 unixodbc odbcinst msodbcsql17*.

* How to install msodbcsql17 - Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS.

qt-sql-example's People

Contributors

andre-wojtowicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.