Data migration saved paths slash is eliminated solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.