我正在使用 Windows,在 java 代码中我创建了一个查询,看起来像,
“加载数据本地 INFILE 'F:/cust_files/1360235457810_customer_xlsx.xlsx.csv' 忽略表 customer.temp_20130207_10098_1360235533471505000 字段由 ',' 终止;”
但是当我运行应用程序时,我得到了文件未找到异常,路径看起来像,
F:cust_files1360235457810_customer_xlsx.xlsx.csv
java.io.FileNotFoundException异常
MESSAGE: F:cust_files1360235457810_customer_xlsx.xlsx.csv(系统找不到指定的文件)
谁能告诉我是什么原因造成的,有什么解决办法
最佳答案
使用双 \\
转发在您的 windows 系统中获得正确的路径。
引用http://dev.mysql.com/doc/refman/5.1/en/string-literals.html
关于java - 获取文件未找到异常,因为路径格式不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14766615/