不知这样行不行
Runtime runtime = Runtime.getRuntime();
runtime.exec( “/usr/local/site/mysql/bin/mysql -u root >dbname.txt” );