Re: JDBC
Posted in 1998
Ben wrote: >Has anyone gotten JDBC to work with servlets for informix? I have >gotten it to work directly from the UNIX prompt, but whenever I try to >connect more than once to a shared memory connection server, I get >errors about shared memory. When I try to connect to tli, I get a -908, >which basically just means that I can't get a connection. > I just delivered a system that uses Informix SE as the RDBMS, JavaWebServer as the page/servlet server, and Intersolv's SequelIink as the JDBC middle layer piece. We created a Connection pooling mechanism that creates a set of connections. When a particlar servlet wants to do database queries, it requests a free connection from the pool, does its bidness, then returns the connection to the pool for further use. This pool is stored within an 'Application servlet' that has a well known name. Any other piece of Java code can get access to it by this name. It holds onto the connection pool as well. The key about servlets is that each #service method executes within its own thread context. A single shared connection held in a static member leads to problems relating to transaction atomicity problem, among other things. Mike Fontenot