By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,934 Members | 1,449 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,934 IT Pros & Developers. It's quick & easy.

JDBC & LOAD DATA LOCAL FILE

P: n/a
Hi,

I am having an issue with the LOAD DATA LOCAL FILE command on the
latest 3.0.9 JDBC Driver. The command works on Windows, but doesn't
seem to work on OSX and Linux. The error that I get on Linux and OSX
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 'FILE
'/home/username/data.txt' INTO TABLE testtable(id, testfield)"

I have written a Java application which takes a SQL command from a
user and then executes it with the driver. The commands that I
execute on the plaforms are ...

Windows:
LOAD DATA LOCAL FILE
'c:\\data.txt'
INTO TABLE testtable(id, testfield)

Linux:
LOAD DATA LOCAL FILE
'/home/username/data.txt'
INTO TABLE testtable(id, testfield)

OSX:
LOAD DATA LOCAL FILE
'/Users/username/data.txt'
INTO TABLE testtable(id, testfield)

I am assuming the issue is probably with the escape sequence on the
file path, but I have tried different combinations with no luck. I
have tried ...

'/home/username/data.txt'
'//home//username//data.txt'
'\home\username\data.txt'
'\\home\\username\\data.txt'

Does anyone know if this is a bug in the JDBC driver?

Any suggestions would be appreciated.

Thanks
John
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.