Zafif, A word of caution: don't ever forget to close ALL Resultset, Statements and Cursors. Don't think that closing the Cursor will automatically freeup the resultset and statement.
We had a horrible time cleaning up code when we saw that the DB will hold the thread/process until the db timed it out. Otherwise the DB server eventually runs out of available thread 'processes'. I.E. Ora-12500 in Oracle Tony ----- Original Message ----- From: "Drew Falkman" <[EMAIL PROTECTED]> To: "JRun-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, February 20, 2002 11:01 AM Subject: RE: Caching connection > Hey- > > JRun offers the ability to pool your database connections using JDBC. You > can setup datasources in the JRun Management Console, then access them using > their datasource name. > > To setup a datasource: > > 1. Login to the JMC, click the plus sign next to the appropriate server > instance in the left menu. This opens the sub-menu for that server. > > 2. Click the JDBC Data Sources link. This will bring up the data source menu > screen on the right frame. > > 3. Click the "add" button - this will start the add datasource wizard. > > 4. On the first screen, select your driver type (MS SQL Server - a native db > driver is included if you are using Advanced or Enterprise), Enter the > datasource name - this is what you will refer to in your application - and a > brief description (optional). > > 5. On the next screen, you are asked for the database address/port number, > the database name (in SQL Server) and security information. Enter the > appropriate responses. > > 6. The next screen will as you for connection information - do you wish to > pool connections (yes, you should, most likely), when should the connection > timeout and at what interval should the connection retry a query if the > database is unavailable or busy. You can also enter any vendor arguments you > like for instantiating the connection. > > 7. Click next and you are finished. > > Now you can refer directly to this datasource in your applications (this is > extremely easy if you are using JSP and the <jrun:sql> tag...) > > Drew Falkman > Author, JRun Web Application Construction Kit > http://www.drewfalkman.com > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 20, 2002 7:56 AM > To: JRun-Talk > Subject: Caching connection > > > Our office is new in implementing J2E technology. We are set up with JRun > and ms > sql server. The db admin was horrifed when he opened the sql server log and > saw > all the connections by one of my applications. > > > Basically, the site queries the db almost at every page, to collect, display > the > different info. So everytime the user browses a page, data is being pulled > from > sql. > > > Am I doing anything wrong? I thought that everytime I connect, I should > close > the connection. > > > I posted this q to javaranch, and one person replied that i should store in > app > level, and another one that JDBC2 Datasource would do that for me. > > > I'm embarrassed to admit but am clueless of what they mean. Can someone > please > explain? > > > Thanks! > > ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
