
|| Parameter\\ || Description || Default value || Required ||
| url \\ | The JDBC URL of the targeted database \\ | \- \\ | Yes \\ |
| driver | The JDBC Driver className. The JDBC library has to be loaded with a SharedLibrary. It is automatically resolved for: mysql,oracle,hsql,sqlserver,derby,postgresql,db2,sybase (according to the jdbc url). | \-\\ | No\\ |
| user\\ | The database user\\ | \-\\ | Yes\\ |
| password\\ | The database password.\\ | \-\\ | Yes\\ |
| maxActive\\ | The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. | 8\\ | No |
| maxIdle\\ | The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit. | 8\\ | No |
| minIdle\\ | The minimum number of connections that can remain idle in the pool, without extra ones being created, or zero to create none. | 0\\ | No |
| maxWait\\ | The maximum amount of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, \-1 to wait indefinitely. | \-1\\ | No |
| timeBetweenEvictionRunsMillis\\ | The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. | \-1\\ | No |
| metadata\\ | If true, When the 'select' operation is used, the response contains metadata on result elements(Row type,index...). | false\\ | No\\ |
{table-plus}
h3. Service Unit descriptor
The SQL component creates dataSource initialized with Service Unit parameters.
You have to deploy a Service Unit with a JBI descriptor containing a provides section and the following parameters.
Here is a sample of a SU JBI descriptor to configure a MyDataBaseSQL service.
{code:xml}
<jbi:jbi version="1.0"
xmlns:interfaceNs="http://petals.ow2.org/components/sql/version-1"
xmlns:jbi="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:serviceNs="http://test"
xmlns:sql="http://petals.ow2.org/components/sql/version-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Import a Service into PEtALS or Expose a PEtALS Service => use a BC. -->
<jbi:services binding-component="true">
<!-- Import a Service into PEtALS => provides a Service. -->
<jbi:provides
interface-name="interfaceNs:SQLInterface"
service-name="serviceNs:MyDatabaseSQLService"
endpoint-name="MyDatabaseSQLServiceEndpoint">
<!-- CDK specific elements -->
<petalsCDK:wsdl>SQLService.wsdl</petalsCDK:wsdl>
<!-- Component specific elements -->
<sql:url>jdbc:mysql://host_name:port/dbname</sql:url>
<sql:user>test</sql:user>
<sql:password>test</sql:password>
<sql:maxActive>8</sql:maxActive>
<sql:maxIdle>8</sql:maxIdle>
<sql:minIdle>0</sql:minIdle>
<sql:maxWait>-1</sql:maxWait>
<sql:timeBetweenEvictionRunsMillis>-1</sql:timeBetweenEvictionRunsMillis>
<sql:metadata>true</sql:metadata>
</jbi:provides>
</jbi:services>
</jbi:jbi>
{code}
h3. Service Unit content
The Service Unit has to contain the following elements, packaged in an archive:
* The META-INF/jbi.xml descriptor file, has described above
{code}
service-unit.zip
+ META-INF
- jbi.xml (as defined above)
{code}
h1. Component Configuration
{note}Caution: the component requires at least a JDBC Shared Library. Please install first a valid Shared Library containing your database JDBC driver. Then you can configure your component by using PEtALS maven plugin with the goal jbi:configure or the PEtALS Ant task petals-configure-component.{note}
The following attributes can be set during the installation phase to configure the component, using the params element of the jbi-install-component ANT task: