Data migration saved paths slash is eliminated solution:
Path = "D:\\temp\\files";
Path = Path.replaceall ("\\\\", "/"); You must use four backslashes to represent a double backslash in the path
"If a path is D:\\temp\\files, then Java escape automatically rejects a" \ ", the path becomes D:\Temp\Files, and when Java saves this data into MySQL, MySQL also rejects a" \ " (This is because MySQL is implemented in the Java language, it does not know the single slash, it will be interpreted as an escape character), so the path saved in the final database is: d:tempfiles so we can use the forward slash instead of the backslash, and the forward slash is compatible with Windows and Linux, but the backslash is not compatible 】
This article is from the "Mr. Eclipse" blog, please make sure to keep this source http://issac.blog.51cto.com/1801082/1589055
Data migration saved paths slash is eliminated solution