David,

you definitely need to see at least the unit test scripts.

All taglibs in jelly src distribution is under <jelly-home>/jelly-tags/<taglib-name> you can see the current version of the svn trunk at http://svn.apache.org/viewvc/jakarta/commons/proper/jelly/trunk/jelly-tags/sql/
among others, I see a catch at:
 src/test//org/apache/commons/jelly/tags/sql/example3.jelly
Sorry for the wrong track.. there's no try just a catch...

As to the var attribute of the query tag... this is really just the result... it is of class org.apache.commons.jelly.tags.sql.ResultImpl I think. Better see the javadoc to see the things you can do on it. Among others, if <query var="r"/> then ${r.rows} will give you an array of maps of length ${r.rowCount}. I'm commenting all this only by reading the source right now... so consider these as hints.

hope that helps.

paul

Karr, David wrote:
Where is an example of how to wrap a "sql:update" in a try/catch?  I
found some limited examples by grepping the core source tree (I can't
find the source for the SQL tag library anywhere), but I don't
understand them.
-----Original Message-----
From: Paul Libbrecht [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 12:38 AM
To: Jakarta Commons Users List
Subject: Re: Can Jelly SQL branch on table existence, or error conditions?

At worst the core's try/catch should help you, or ?
Feel free to suggest added tags such as "tableAvailable" or "dbMetadata" or...
paul

Karr, David wrote:
I'm guessing the primary commons-user answerers are in a very different time zone, so I guess I'm going to burst out a bunch of questions, instead of waiting for answers for each one.

In my Jelly SQL script, I'm going to need to drop and
recreate a set
of tables. In order for this to work, it has to deal with any variation of those tables existing or not. For instance,
if the table
doesn't exist, dropping the table will fail in some way, so
I'll need
to be able to ignore the error, perhaps. If I did this
with plain sql
tasks in Ant, it will just fail the Ant script if the drop
fails, and
I don't see how to get back info into the Ant script indicating whether the table exists or not.

Is this feasible in Jelly SQL?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to