I am making a standalone application using java,and in that i need to insert the path of the image that user chooses from file chooser.
I am getting the path of the file but when i store it in the database(mysql) it doesn't stores the \,so when i retrieve that path,the file doesn't show up.
How to store the path of file with \\ so that one gets escaped using java code?
i tried using replaceall method but its giving an error of illegal character set.
filename.replaceall("\","\\");
But this didn't work out.
解决方案
Use Prepared statement to store path containing \.PreparedStatement doesn't escape anything