Yes Mark it worked from the command line.
The Archived resides at the server side.
I ran Load data local infile 'sys:\\mail\\dump.txt" into table X
it worked.
The from a different machine i ran this java program. The Archived
file still exists at the DB server side.
So i guess local option is not necessary. It didnt work though
I guess the path it takes is wrong.
String filepath = "sys:\\restore\\data1.txt";
String query = "load data local infile \'" + filepath + "\' into table
x
it takes as estoredata1.txt as file name not clear why ?
Like to add here that Select * into outfile works perfect from JDBC
wiht same filepath
>>> Mark Matthews <[EMAIL PROTECTED]> Wednesday, February 12, 2003 7:49:42
PM >>>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ahmed S K Anis wrote:
> Thanks Mark,
>
> I tried to work with the latest driver. 3.0.4
> Now it gave error shown below . Also see code snippet below at the
> end
>
> Error code is0
> estoredata1.txt'for 'LOAD DATA LOCAL INFILE' command.Due to
underlying
> IOExcepti
> on:
>
> ** BEGIN NESTED EXCEPTION **
>
> java.io.FileNotFoundException
> estoredata1.txt (The system cannot find the file specified)
>
> STACKTRACE:
>
> estoredata1.txt (The system cannot find the file specified)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:59)
> at
com.mysql.jdbc.MysqlIO.sendFileToServer(MysqlIO.java:1505)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:964)
> at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:911)
> at com.mysql.jdbc.Connection.execSQL(Connection.java:1777)
> at com.mysql.jdbc.Connection.execSQL(Connection.java:1711)
> at
com.mysql.jdbc.Statement.executeUpdate(Statement.java:1293)
> at Sanity.Restore(Sanity.java:138)
> at Sanity.main(Sanity.java:70)
>
>
> CODE SNIPPET
>
> String filepath = "sys:\\restore\\data1.txt";
> String query = "load data local infile \'" + filepath + "\' into
table
> trail";
>
> stmt.executeUpdate(query);
>
> what could be wrong here ?
First, you do realize that 'load data local infile' means load the file
that is on the client and send it to the server.
Second, Java is saying it can't open the file 'estoredata1.txt', which
either means it doesn't exist at the path you say it does, or the
permissions are wrong. Can you load this same file using the MySQL
command-line client using the _exact_ same path?
-Mark
- --
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/
For technical support contracts, visit
https://order.mysql.com/?ref=mmma
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer -
JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+Slf+tvXNTca6JD8RAq+YAJ0bV2N62jOE7UsCOL2aOH4A7Y2MnACgiQRw
uLPb/oWgEJubdksxBafP6RU=
=uzys
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php