You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Explicit ResultSet shape degfinition

The RDB DAS provides the ability to specify format(shape) of the ResultSet. This is necessary when the JDBC driver in use does not provide adequate support for ResultSetMetaData. Also, we expect that specifying the result set shape will increase the performance. The following is the provision in RDB DAS config to specify result set shape:

<xsd:complexType name="Command">
   <xsd:sequence>
     ....
      <xsd:element  maxOccurs="unbounded" minOccurs="0"
            name="ResultDescriptor"  type="config:ResultDescriptor"/>      
   </xsd:sequence>
   ....
</xsd:complexType>

<xsd:complexType name="ResultDescriptor">
  <xsd:attribute name="columnName" type="xsd:string"/>      
  <xsd:attribute name="tableName" type="xsd:string"/>
  <xsd:attribute name="columnType" type="xsd:string"/>
</xsd:complexType>
...

The following is an example config file that defines a result set shape: :

<Config xmlns="http:///org.apache.tuscany.das.rdb/config.xsd">  
  <Command name="literal" SQL="Select 99, 'Roosevelt', '1600 Pennsylvania Avenue' from customer" kind="Select"> 	
  <ResultDescriptor columnName="ID" tableName="CUSTOMER" 
      columnType="commonj.sdo.Long"/> 		
  <ResultDescriptor columnName="LASTNAME" tableName="CUSTOMER" 
      columnType="commonj.sdo.String"/> 		
  <ResultDescriptor columnName="ADDRESS" tableName="CUSTOMER" 
      columnType="commonj.sdo.String"/> 	
</Command>  
<Table tableName="CUSTOMER"> 
<Column columnName="ID" converterClassName="org.apache.tuscany.das.rdb.test.mappings.StringToLongConverter"/>   
</Table>	
</Config>
  • No labels