• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Connection Pooling

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to know what is connection pooling in JBoss? and how it is used to access SOL and ORACAL database?. Can connection pooling be done throgh coding? If so anybody has sample code snippets please do farward me.

Regards
Jayant
[ May 03, 2005: Message edited by: jayant bhoge ]
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by jayant bhoge:

I want to know what is connection pooling in JBoss? and how it is used to access SOL and ORACAL database?. Can connection pooling be done throgh coding?



Connection pooling is concept to cache the connection rather creating Connection to database everytime you need it.SInce invoking a connection nuumber of times would be costly.In Connection pooling a connection is shared among multiple requests.

Connection pooling can increase performance dramatically by reusing connections rather than creating a new physical connection each time a connection is requested. The ability to use distributed transactions enables an application to do the heavy duty database work of large enterprises.

You can implement Connection pooling in your code also ,but almost every application provide connection pooling via data sources.
So instead of re-inventing the wheel you can use existing one.

Connection pooling in app server is always same regardless whatever application server.

Datasource also helps you migrate from one database to another without any code change provided you are using ANSI sql.

Shailesh
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hsqldb-ds.xml,this file in deploy folder in jboss.

u have to modify for oracle




<?xml version="1.0" encoding="UTF-8" ?>
- <!-- =====================================================================
-->
- <!--
-->
- <!-- JBoss Server Configuration
-->
- <!--
-->
- <!-- =====================================================================
-->
- <!-- $Id: hsqldb-ds.xml,v 1.1.2.4 2003/04/22 20:34:33 d_jencks Exp $
-->
- <datasources>
- <local-tx-datasource>
- <!-- remove this depends tag if you are not using the tcp connection url
-->
<depends>jboss:service=Hypersonic</depends>
<jndi-name>DefaultDS</jndi-name>
- <!-- for tcp connection, allowing other processes to use the hsqldb database
-->
<connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
- <!-- for totally in-memory db, not saved when jboss stops. hsql mbean is unnecessary
-->
- <!-- connection-url>jdbc:hsqldb:.</connection-url
-->
- <!-- for in-process db, saved when jboss stops. hsql mbean is unnecessary
-->
- <!-- connection-url>jdbc:hsqldb efault-db-name</connection-url
-->
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<user-name>sa</user-name>
<password />
- <!-- example of how to specify class that determines if exception means connection should be destroyed
-->
- <!-- exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name
-->
<min-pool-size>5</min-pool-size>
<security-domain>HsqlDbRealm</security-domain>
</local-tx-datasource>
- <!-- this mbean should be used only when using tcp connections
-->
- <mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic">
<attribute name="Port">1701</attribute>
<attribute name="Silent">true</attribute>
<attribute name="Database">default</attribute>
<attribute name="Trace">false</attribute>
<attribute name="No_system_exit">true</attribute>
</mbean>
</datasources>
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic