JDBC and outfile/infile





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
.



Relevant Pages

  • Re: JDBC and outfile/infile
    ... >Mike wrote: ... >> I have MySQL and want to dump the contents of a table into a text file ... Can that be done with JDBC? ...
    (comp.lang.java.databases)
  • Re: How to modify a MySQL database...
    ... and then update them with Java. ... To learn how to create a MySQL database, ... you will need to learn JDBC. ...
    (comp.lang.java.programmer)
  • Re: komplettes Backup mit mysqldump
    ... jeweiligen Charset-Einstellungen in den Dump. ... ich verwende noch eine etwas betagte "MySQL - 4.0.24". ... Tabellen und Spalten damit. ... GRANTs sind viel besser lesbar. ...
    (de.comp.datenbanken.mysql)
  • Re: OT: Request for Assistance
    ... You'll probably need JDBC, but you have to get it manually. ... It's mostly using MySQL, ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ... Modify settings or unsubscribe at: ...
    (Ubuntu)
  • Re: Defektes Dump dennoch einspielen
    ... > defektes Filesystem hin oder auf gleichzeitige Zugriffe auf die MySQL ... selbst wenn der Dump inkonsistent ist (was bei einem Dump-Vorgang ... Next by Date: ... Previous by thread: ...
    (de.comp.datenbanken.mysql)