views:

249

answers:

1

I'm profiling some APIs to see which one is suitable for this project.

I want my Qt app to connect to a database over an internet connection. Can Qt do this with the client application alone or do I need to write a server app to sit on the database server and transact the queries?

+2  A: 

You can perfectly well connect to databases over TCP/IP as long as the database engine supports that (most do!). See the example in the docs, it has a db.setHostName("acidalia"); to connect to a PostgreSQL database on that host...

Alex Martelli
Indeed, but I saw no example with the host name as a network address. I guess I can just place a network address in there then? That simple?(Just checking on the capabilities before I invest the time on the API)
CptAJ
Yep, as long as you have the needed driver, also set the port if it's not what the driver considers to be the standard one for that DB, and the like.
Alex Martelli