Re: problem executing batch files

Mark Matthews <[email protected]>
Newsgroups gmane.comp.db.mysql.java
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nicklers wrote:
> hello there. im encoutering problem in restoring my database using a text
> file. everytime i run my codes nothing happens. this is my code:
> 
> try
> {                     
>             Runtime.getRuntime().exec("C:\\Program Files\\MySQL\\MySQL
> Server 4.1\\bin\\mysql -u root -p032702 gino < sqlDump.sql");
>          
>  }
> catch(Exception e)
> {
>             System.out.println(e.getMessage());
>             System.out.println(e.getCause());
>  }
> 
> can someone help me with this? this is really important.

Nicklers,

Runtime.exec() has an interesting side effect that if you don't capture
the standard out and error streams (call getInputStream() and
getErrorStream() on the java.lang.Process returned by Runtime.exec(),
and read them, one thread for each), it will appear to hang.

	-Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)

iD8DBQFFW+KNtvXNTca6JD8RAk0MAJ0U45EWWnEtV1Rx0ElhB/kbs9ixAACeMASK
VGwmsbu/RwvClBtYPvbxfjI=
=983+
-----END PGP SIGNATURE-----

-- 
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.