Many Apache projects support interaction with a relational database. Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds. Opening a connection per user can be unfeasible in a publicly-hosted Internet application where the number of simultaneous users can be very large. Accordingly, developers often wish to share a "pool" of open connections between all of the application's current users. The number of users actually performing a request at any given time is usually a very small percentage of the total number of active users, and during request processing is the only time that a database connection is required. The application itself logs into the DBMS, and handles any user account issues internally.WEB-INF/cloudbees-web.xml<?xml version="1.0"?><cloudbees-web-appxmlns="http://www.cloudbees.com/xml/webapp/1"> <resourcename="jdbc/DATASOURCE_NAME"auth="Container"type="javax.sql.DataSource"> <paramname="username"value="USERNAME"/> <paramname="password"value="PASSWORD"/> <paramname="url"value="JDBC_URL"/> <!-- Connection Pool settings --> <paramname="maxActive"value="5"/> <paramname="maxIdle"value="2"/> <paramname="maxWait"value="10000"/> <paramname="removeAbandoned"value="true"/> <paramname="removeAbandonedTimeout"value="60"/> <paramname="logAbandoned"value="true"/> <!-- Purge invalid connections --> <paramname="validationQuery"value="SELECT 1"/> <paramname="testOnBorrow"value="true"/> </resource></cloudbees-web-app>WEB-INF/web.xml<resource-ref><res-ref-name>jdbc/DATASOURCE_NAME</res-ref-name><res-type>javax.sql.DataSource</res-type><res-auth>Container</res-auth></resource-ref>
The database is simply available as a JNDI resource as soon as it is deployed – there is no need to chase down JDBC drivers, connection strings and configure JNDI.
Java PaaS Application Deployment on CloudBees - Demo http://clean-clouds.comhttp://clean-clouds.com
MySQL database Management of your database is typically done using a MySQL client like the mysql command line program distributed with MySQL Apache DBCP connection pool implementation External Databases ◦ To connect your application to a non-CloudBees database, define the database as a resource-ref in the app web.xml file,and bind it to your database as a resource in the cloudbees-web.xml file and include the standard JDBC connection settings for connecting to the database. Database as a Servicehttp://clean-clouds.com
Subscription of RUN@cloud Database Servicehttp://clean-clouds.com
Create a MySQL databasehttp://clean-clouds.com