3 messages in com.mysql.lists.javaRe: statements cut off using jdbc driver
FromSent OnAttachments
Eric Weidner19 Jun 2004 18:01 
Bill Easton20 Jun 2004 04:31 
Mark Matthews20 Jun 2004 05:40 
Subject:Re: statements cut off using jdbc driver
From:Mark Matthews (ma@mysql.com)
Date:06/20/2004 05:40:22 AM
List:com.mysql.lists.java

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

Eric Weidner wrote:

Going through Ant and DbVisualizer, I am getting my statements cut off using the 3.0.14 Connector/J driver.

The command is: source /sata1/dev/projects-head/project1/target/dbinstall/mysql/load.sql

which will call other source files. Relative paths cause problems so I need the full path.

The response is: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'source /sata1/dev/projects-head/project1/ target/dbinstall/mys" ... 1 statement executed, 0 row affected, execution time 0.000 sec

As you can see, the jdbc driver seems to cut off the command during sending. I reverified the problem in DBVisualizer so it's not the Ant SQL task. I've even tried breaking the line with similar results. The schema.sql contains other source commands that will die in a similar manner.

If I run the set of sql scripts directly in MySQL 4.0.20, they run fine.

Is this a bug in the driver? Any workaround (other than relocating all my projects in / (symlinks get expanded)?

Eric,

The JDBC driver doesn't understand 'source' commands, that's a feature that's present in the MySQL command-line client only.

The JDBC driver only passes SQL to the server, so only SQL commands/queries that the MySQL server understands can be used with the JDBC driver.

Regards,

-Mark

- -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 332 0507 www.mysql.com

MySQL Guide to Lower TCO http://www.mysql.com/it-resources/white-papers/tco.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA1YXMtvXNTca6JD8RAsfDAJ9iwaUIPId5ye3H9+wGcA1w45Oa/wCgoLen za8J1We8EuUi4LdrUfwCICI= =mb+y -----END PGP SIGNATURE-----