here is my code
try{
String logf = "mysql -p -h localhost ruralcdn<E:\\data\\DBServer\\"+FileName;
System.out.println("Command"+logf);
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec(logf);
int lm = pr.waitFor();
System.out.println("lm"+lm);
System.out.println("!!Done!!");
}catch(Exception ex){
System.out.println("!!error!!");
}
when i compile the above code, it hangs for infinite period of time and no entry updated in my database. when i tried using the method given below
Connection conn = dbConnectionSource.getConnection();
Statement stmt = conn.createStatement();
stmt.execute(FileUtils.readFileToString(new File("./some-sql-file")));
console displayed error:you have an error in your sql syntex
please help me so that i can do things correctly.
Thanks -A