Hi Tom,

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.
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.

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?

thx
Laurent


Thomas Dudziak wrote:

>On 2/28/06, Laurent Sacaut <[EMAIL PROTECTED]> wrote:
>
>  
>
>>I ran the sql generated by torque as you suggested (the 3 files it
>>created: create-db.sql, ojbcore-schema.sql and project-schema.sql) and
>>they are fine. No error from MySQL 5.0 and all the tables are created.
>>
>>I am suspecting something subtile such as the order of the jar, or other
>>configuration settings or file location.
>>    
>>
>
>It could be anything really. You should ensure that you're using the
>newest JDBC driver. And you could test to execute the creation sql
>with your connection settings in a tool like Squirrel SQL
>(http://squirrel-sql.sourceforge.net/) to ensure that the user (i.e.
>'[EMAIL PROTECTED]') is allowed to do this.
>
>Tom
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>

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

Reply via email to