在play框架中找不到文件异常

时间:2015-05-21 09:31:38

标签: file scala playframework-2.2 filenotfoundexception

我的应用程序根目录中有一个名为 product.csv 的文件。我想从文件中读取。但我得到文件未找到异常。这是我写的代码。

SELECT tenant_charge_date as statement_date, tenant_charge_id as reference, tenant_charge_total_amount as debit, NULL as credit, 'Charge' as type FROM accounts_tenant_charge
UNION ALL
SELECT tenant_payment_date as statement_date, tenant_payment_id as reference, NULL as debit, tenant_payment_amount as credit, 'Payment' as type FROM accounts_tenant_payment
ORDER BY statement_date

我做错了什么?

修改 顺便说一句,如果这对我有用,我正在使用Windows操作系统。

1 个答案:

答案 0 :(得分:1)

您需要使用相对文件路径"product.csv"而不是"/product.csv"来查看驱动器的根目录。