Skip to Content.
Sympa Menu

freetds - Re: [freetds] connection pooling

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] connection pooling
  • Date: Wed, 27 Oct 2004 23:27:28 -0400

Shaun Craig <s.craig AT andronics.com> wrote:
> I currenly have a C program
> that can query and insert to MS SQL on a windows machine, now i want to
> set up connection pooling but dont know how. I've set up the
> freetds.conf and pool.conf files ok and can tdspool myspool and start
> the server, i dont know how to point my C program at the server?

In pool.conf, you define a port that the pool server listens to, something
like this:

[mypool]
user = webuser
password = secret
database = ebiz
server = fooserv
max pool conn = 7
port = 5555

In freetds.conf, you declare a server entry pointing to it:

[pool]
host = localhost #if that's where it's running
port = 5555
tds version = 4.2

Then, you connect to [pool] per usual:

DBPROCESS *db = dbopen (login, "pool");

HTH.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page