Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Example: error loading a mysqldump file

Example: error loading a mysqldump file

2006-10-27       - By Steve Loughran
Reply:     <<     11  

Scot P. Floess wrote:
> Steve:
> Now that I give this some deeper thought...I see now what the intent
> is...  I got hung up on dual by <sql> task and one the the
> JDBC layer:  clearly one has to be able to issue a sql statement - thus
> the delimiter attribute - duh on my part :(
> I do see your point...and well taken ;)

I still think there is a bit of a mess in delimiter handling.

I have forked off some of the code for my own use

Not having to care about backwards compat I dont need to worry about
breaking anything. I've tried to be a bit more consistent. As an example
compare its crackCommands() method with SqlExec.runStatements() :-

Mine is a lot simpler, and I trim off the whitespace before looking for
a delimiter at the end of the line. On the <sql> task, if you have
keepformat=true, then a delimiter followed by whitespace doesnt (on my
looking at the code) appear to get picked up right.

The other dirty secret about <sql> is that, right now, there are no
tests for it. Its one of those things that needs functional testing, not
unit tests. We could (and should) use HSQLDB, but that wouldnt catch
bugs against mssql, oracledb, postgres and mysql.

> Although, it still "feels" like there ought to be a way to hand off the
> whole file's contents to the JDBC layer and do no parsing in the <sql>
> task.

There's no easy way that I know of.


To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.