Results 1 to 1 of 1

Thread: QSql connection pool manager

  1. #1
    Join Date
    Oct 2011
    Posts
    51
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QSql connection pool manager

    Hi!
    I am writing a application that gets data from a MYSQL database, now I have only one connection and everything is done "one by one" but meany of those operations can by made in parallel so I decided to create a connection pool with ~5 connections and then use them in parallel. like
    Qt Code:
    1. thread1.exec("select * from x");
    2. thread2.exec("select col1,col2 from y");
    3.  
    4. thread1.join();
    5. thread2.join();
    6.  
    7. while (thread1.next()){ ... }
    8. while (thread1.next()){ ... }
    To copy to clipboard, switch view to plain text mode 

    As far as I know I can use for this purpose QThreadPool and some other "magic" to hold each connection in separate thread, and then do some query on those connections, but in first place I want to ask if somebody know something about a simple library written for Qt that does this king of stuff?

    **** EDIT ***
    I've managed to do something like i wanted using http://www.linuxjournal.com/article/9602?page=0,0, but still waiting for a library
    Last edited by cszawisza; 22nd April 2014 at 22:28.

Similar Threads

  1. Qsql and connection
    By smemamian in forum Newbie
    Replies: 15
    Last Post: 5th April 2013, 18:05
  2. Replies: 4
    Last Post: 30th January 2011, 14:34
  3. Replies: 10
    Last Post: 23rd July 2009, 00:52
  4. connection with qsql module
    By adamatic in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2009, 11:38
  5. 3D rendering of a pool table
    By Israa in forum General Programming
    Replies: 5
    Last Post: 4th March 2007, 15:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.