|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (23)
View Page Historyh2. Usage
h3. Execute Select Operation
When the {{execute}} operation is set on the incoming message exchange, the component performs the SQL instructions contained in the IN message. If the execution returns information (an SQL SELECT for example), the OUT message contains the SQL ResultSet.
{info}If you want to see extra information on the response, you can set the show-metadata attribute to true. The response will contains row index, column name and type.{info}
The IN message looks like :
{info}If you want to see extra information on the response, you can set the show-metadata attribute to true. The response will contains row index, column name and type.{info}
The IN message looks like :
When the {{select}} operation is set on the incoming exchange, the component performs the SQL SELECT instructions defined in the {{sql}} element of the IN message. the OUT message returned contains the SQL Result Set.
{info}If you want to get meta-data (name of a column, type of a column, index of a row) in the response, you must activate the meta-data feature. This feature can be set at the Service definition, in the SU, or at runtime, by setting a property 'metadata' to {{true}} in the IN message.
{info}
Example of a IN message :
{info}If you want to get meta-data (name of a column, type of a column, index of a row) in the response, you must activate the meta-data feature. This feature can be set at the Service definition, in the SU, or at runtime, by setting a property 'metadata' to {{true}} in the IN message.
{info}
Example of a IN message :
{code:xml}
<execute xmlns="http://petals.ow2.org/components/sql/version-1">
<sql show-metadata="true">SELECT xmlns="http://petals.ow2.org/components/sql/version-1">SELECT name, firstname FROM user WHERE id='123'</sql>
{code}
The OUT message returned to the consumer contains the XML representation of the ResultSet returned by the SQL statement execution. If metadata have been enabled, their are set as attributes.
Example of an OUT message returning the content of the SQL Result Set in a XML representation.
{code:xml}
<executeResponse <result xmlns="http://petals.ow2.org/components/sql/version-1">
<row index='1'>
<column name='name' type='varchar'>Field</column>
<column name='name' type='varchar'>Field</column>
<column name='firstname' type='varchar'>John</column>
</row>
</row>
</executeResponse> </result>
{code}
{info}The ResultSet can be written in the OUT message by a thread while the reponse message is sent back by another thread (pipes strreaming mechanism), increasing performance. To enable this feature, set the {{org.ow2.petals.transport.streaming=true}} property on the JBI Exchange, or set the {{streamingMode}} parameter of the Service Unit (in this case, the streaming mode is active for all requests).{info}
{info}The execute operation is defined in the SQL component abstract WSDL. You can import this abstract WSDL and define a concret WSDL to reference in your SU.{info}
{info}The execute operation is defined in the SQL component abstract WSDL. You can import this abstract WSDL and define a concret WSDL to reference in your SU.{info}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color}\\ || {color:#333333}Default{color}\\ || {color:#333333}Required{color}\\ ||
| provides | Describe the JBI service that will be exposed into the JBI bus. Interface (QName), Service (QName) and Endpoint (String) attributes are required. | \- | Yes |
| provides | Describe the JBI service that will be exposed into the JBI bus. Interface (QName), Service (QName) and Endpoint (String) attributes are required. | \- | Yes |
{table-plus}
{table-plus}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color}\\ || {color:#333333}Default{color}\\ || {color:#333333}Required{color}\\ ||
| timeout | Timeout in milliseconds of a synchronous send. This parameter is used by the method {{sendSync}} (Exchange exchange) proposes by the CDK {{Listeners}} classes. \\
| timeout | Timeout in milliseconds of a synchronous send. This parameter is used by the method {{sendSync}} (Exchange exchange) proposes by the CDK {{Listeners}} classes. \\
{table-plus}
{petalslink}{include:0 CDK SU Provide Configuration}{petalslink}
\\
\\
{table-plus}
{table-plus}
|| Parameter \\ || Description || Default value || Required ||
| url \\ | The JDBC URL of the targeted database \\ | \- \\ | Yes \\ |
| url \\ | The JDBC URL of the targeted database \\ | \- \\ | Yes \\ |
h3. Service Unit descriptor
h3. Service Unit content
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}
{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:
{table-plus}
{table-plus}
|| {color:#333333}Parameter{color} || {color:#333333}Description{color} || {color:#333333}Default{color} || {color:#333333}Required{color} || {color:#333333}Required{color} ||
| acceptor-pool-size | The size of the thread pool used to accept Message Exchanges from the NMR. Once a message is accepted, its processing is delegated to the processor pool thread. | 3 | Yes | Runtime |
| acceptor-pool-size | The size of the thread pool used to accept Message Exchanges from the NMR. Once a message is accepted, its processing is delegated to the processor pool thread. | 3 | Yes | Runtime |
| jbi-listener-class-name | Qualified name of the class extending *AbstractJBIListener* | \- | Yes | Component |
{table-plus}
{table-plus}
{table-plus}
{petalslink}{include:0 CDK Component Configuration Table}{petalslink}