[freetds] connection pooling

Shaun Craig s.craig at andronics.com
Thu Oct 28 05:21:17 EDT 2004


On Thursday 28 October 2004 04:27, James K. Lowden wrote:
> 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
>
>
>Thanks for the above. do i just use my normal functions after i call the 
above line. 
this is the order i have them in
dbinit()
dblogin()
dbsetluser()
dbsetlpwd()
dbopen()
dbuse()
dbquery()
dbsqlexec()
dbresult()
dbbind()
dbnextrow()
dbfreebuf()
dbclose()
dbexit()

any help would be great, thanks again!


> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds


More information about the FreeTDS mailing list