Jetty is a project at the Eclipse Foundation.
| Homepage: | http://www.eclipse.org/jetty |
| Downloads: | http://download.eclipse.org/jetty/ |
| Documentation: | http://www.eclipse.org/jetty/documentation/current/ |
| About: | http://www.eclipse.org/jetty/about.php |
| Jetty Powered: | http://www.eclipse.org/jetty/powered/ |
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
NB: Please read through the generic JNDI instrutions for the background to configuring datasources.
DataSource Examples
Here are some examples of setting up a DataSource in JNDI for various databases.
These examples all correspond to a <resource-ref> in web.xml like:
We will assume that all of the datasources are declared at the jvm scope, but this can be changed as needed.
Don't forget that all JNDI resources can be configured in a jetty.xml file or in a WEB-INF/jetty-env.xml file, or a context xml file. More information on that can be found here.
Pooling DataSources
Enables connection pooling.
Connection pooling is basically re-using existing connections instead of creating a new connection to the database.
This would be highly efficient in terms of memory allocation and speed of the request to the database.
In production, this is highly recommended.
c3p0 (connection pooling)
available at http://repo1.maven.org/maven2/c3p0/c3p0/0.9.1.2/c3p0-0.9.1.2.jar
dbcp (connection pooling)
available at http://repo1.maven.org/maven2/commons-dbcp/commons-dbcp/1.2/commons-dbcp-1.2.jar
Atomikos 3.3.2+ (connection pooling + XA transactions)
Non-pooling DataSources
If you're deploying in production environment, use the #Pooling DataSources instead.
MySQL
implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource
SQL Server 2000
implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource
Oracle 9i/10g
implements javax.sql.DataSource, javax.sql.ConnectionPoolDataSource
PostgreSQL
implements javax.sql.DataSource
implements javax.sql.ConnectionPoolDataSource
Sybase
implements javax.sql.DataSource
DB2
implements javax.sql.DataSource
implements javax.sql.ConnectionPoolDataSource