只有当数据库名称包含类似(新数据库(myid)等时,我才能读取文件。我给出以下示例代码:
dumpCommand = "C:/Program Files/MySQL/MySQL Server 5.0/bin/mysqldump -h"+hostName+user+databaseName;
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(dumpCommand);
InputStream in = proc.getInputStream();
BufferedReader br=new BufferedReader(new InputStreamReader(in));
String line =null;
while((line=br.readLine())!=null)
{
//able to read line only when database name like abc,datastore etc...
System.out.println(line);
}
假设我的数据库名称 de mo 意味着当我打印行时,我得到的数据库名称只有 de。当数据库名称带有空格时可以吗?