您好我正在尝试使用休眠将文件中的数据加载到 Mysql DB。
这是查询,
session.createSQLQuery("LOAD DATA INFILE E:/uploaded/NumSerie/NS/NumSerie.txt INTO TABLE prod CHARACTER SET latin1 FIELDS TERMINATED BY ';' LINES TERMINATED BY '\n' IGNORE 1 LINES;").executeUpdate();
但我收到以下错误,
org.hibernate.QueryException: Space is not allowed after parameter prefix ':' [LOAD DATA INFILE E:/uploaded/NumSerie/NS/NumSerie.txt INTO TABLE prod CHARACTER SET latin1 FIELDS TERMINATED BY ';' LINES TERMINATED BY '
' IGNORE 1 LINES;]
at org.hibernate.engine.query.ParameterParser.parse(ParameterParser.java:92)
at org.hibernate.engine.query.ParamLocationRecognizer.parseLocations(ParamLocationRecognizer.java:75)
如何重写此查询以便正确执行?
提前致谢!