Re: using LOAD DATA LOCAL INFILE with java.sql
Posted by: Mark Matthews
Date: August 01, 2005 08:38PM

mho salim wrote:
> I am trying to load a file onto a table in a
> remote database that is running MySQL version 4.04
> .
> Using the query String
> -- LOAD DATA LOCAL INFILE 'myfile.ext' IGNORE
> INTO TABLE `mytable` -- through
> java.sql.Statement.execute() method from inside my
> Java program I get the error message
> -- java.sql.SQLException: General error: The
> used command is not allowed with this MySQL
> version --
>
> This same query String works fine from a
> Commercial SQL client on the same machine with the
> same database (I am using EMS MySQL Manager
> 3.1.01)
>
> The Java connection is made with
> -- Class.forName("org.gjt.mm.mysql.Driver");
> -- Connection con =
> DriverManager.getConnection(db, user, password)
> --
> where --
> db="jdbc:mysql://mydatabase:3306/dbname?MYSQL_OPT_
> LOCAL_INFILE=1&allowUrlInLocalInfile=true"
> --
>
> has anyone else seen this problem? Is there a
> trick to this?


Mho,

You don't happen to say what version of the JDBC driver you're using, but recent versions support this. You're also using a pretty old version of MySQL 4.0.x, I'd suggest upgrading to something more current for both server and client before debugging this further if you can.

-Mark

Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools
Oracle
http://www.mysql.com/products/enterprise/monitor.html

Options: ReplyQuote


Subject
Written By
Posted
Re: using LOAD DATA LOCAL INFILE with java.sql
August 01, 2005 08:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.