On 3/1/06, Laurent Sacaut <[EMAIL PROTECTED]> wrote:

> I tested the sql statements generated by torque in project--schema under
> build/database directly in the mysql command-line AND using mysqlcc and
> they work just fine.

Please use a tool that uses the JDBC driver, e.g. Squirrel SQL, or
Ant's sql task.

> I then created a small java class with a simple jdbc connection to run
> the same statment and i got some interesting results.
>
> When I use the executeQuery method such as stmt.executeQuery(sSQL); a
> similar error as mentioned in the original post stating that there is a
> syntax error or access violation. (I used a user/password combination
> that had rights to do so)
> Then I tried the executeUpdate method.
>
> I get no error when each statement is passed to the method separately.
> When I feed the whole file as a string, such as the 'drop table if
> exists ...' statement and the 'create table ...' statement separated by
> a semi-colon (;), I get a syntax error near the ';', which seems to make
> sense since the javadoc on the Statement java class does not mention
> that it can process multiple sql statements.
>
> I would think Torque would be able to handle this situation, maybe I am
> missing a library.

That is to be expected because AFAIK Torque does not execute the
generated SQL in one execute call but rather splits them.

> It seems that I am running into a parsing problem. I noticed that
> ojb-blank does not contain xercesImpl.jar, so I added one from another
> project but the version of it might be more or less compatible.
> How come the build-torque file refers to libraries that are not present
> in ojb-blank?

This is because its quite big, and all newer java distributions
contain an XML parser (I don't think Torque specifically needs Xerces,
they only require an XML parser), so there is usually no need to
include it into ojb-blank. Btw, you would have encountered an XML
parser way before these SQL problems - in fact you should not get that
far at all if you miss an XML parser.

Tom

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

Reply via email to