Re: JDBC and outfile/infile
- From: IchBin <weconsul@xxxxxxx>
- Date: Tue, 29 Nov 2005 18:06:50 -0500
Mike wrote:
I have MySQL and want to dump the contents of a table into a text file then read it back in. Can that be done with JDBC? is each a Query or Update?
--------------------- tried ----------------------------
sql="select * into outfile '/tmp/foo.txt' from foo"; rset = stmt.executeQuery(sql);
--------------------- also ---------------------------
sql="load data infile '/tmp/foo.txt' into table foo";
int rows = stmt.executeUpdate(sql);
-----------------------------------------------------
where foo is the table.
Thanks
Does this help.
The SELECT ... INTO OUTFILE 'file_name' form of SELECT writes the selected rows to a file. The file is created on the server host, so you must have the *FILE privilege* to use this syntax. file_name cannot be an existing file
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"' -William E. Taylor, Regular Guy (1952-) .
- References:
- JDBC and outfile/infile
- From: Mike
- JDBC and outfile/infile
- Prev by Date: JDBC and outfile/infile
- Next by Date: Advice needed regarding secure connections between java client and MySQL
- Previous by thread: JDBC and outfile/infile
- Next by thread: Advice needed regarding secure connections between java client and MySQL
- Index(es):
Relevant Pages
|