jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Ballance <balla...@erols.com>
Subject Re: SQLTags 0.0.1b Released
Date Wed, 20 Mar 2002 14:10:09 GMT
I just sent the following to S. Olsen, but I thought that it may be 
appropriate for what you're suggesting.  After reading, continue here * 
It may be easy to map an XML file into a CachedRowSet.  Columns that 
contain another CachedRowSet object would simulate the
hierarchical nature of XML.

*****************
Steve,
   I'd like to suggest some future enhancements to your SQLTags that you 
may find useful.
It would be good to be able to use a CachedRowSet as the backing store 
for the database
operations.  Doing so would allow one to use the tag in more complex 
scenarios where the
data may be passed between Java objects.
   I have implemented a data transport layer in a commercial application 
that builds the proper
metadata for a CachedRowSet from XML.
Example:
<RowSetMetaDataDescriptor name="PaymentDataReply" description="Payment 
Reply Data">
   <column>
       <name>PR_MERCHANT_NAME</name>
       <type>java.sql.Types.VARCHAR</type>
       <nullable>true</nullable>
   </column>
...
   <column>
       <name>PR_AUTH_RESPONSE_MESSAGE</name>
       <type>java.sql.Types.VARCHAR</type>
       <nullable>true</nullable>
       <filter>org.ets.waf.util.StringUtil.toLowerCase</filter>
       <filter>org.ets.waf.util.StringUtil.reverse</filter>
   </column>

A tool could automatically generate this from a database table/view as 
well.  As you can see,
I have added filters to the PR_AUTH_RESPONSE_MESSAGE as well.
This can be used to enforce constraints or do data conversions in-line 
when the fields are set.
This would relate to your SQLTags when you're doing insert/update 
operations.
The metadata XML could also include a column's display label, etc. as well.
In this way, we would be dealing with a well known data structure to 
hold the info and provide
great flexibility.

Problems.
1.  How are exceptions dealt with?  What happens when a filter fails or 
a non-nullable column is
attempted to be inserted/updated as null.
2.  How are large result sets handled?  Is there a max rows property 
that could limit memory
consumption.
*********
Shawn Bayern wrote:

>On Wed, 20 Mar 2002, Kit Westneat wrote:
>
>>I wonder if it would be possible to create a JDBC driver that could
>>simulate a connection to XML document data. I guess one would probably 
>>have to write an SQL interpreter for it though or something, I dunno.
>>Seems like that sort of thing might be useful; interesting at least.
>>
>
>Sure.  JDBC need not use SQL, either; you could write a JDBC driver that
>allowed XPath queries, for instance.
>



--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message