我正在测试来自Teradata官方网站的fastload示例代码。为了保险起见,我使用他们在这里的samples.jar中位于
FastLoad1.csv
文件夹中的示例文件。
运行此示例代码时,在此行中出现错误:
pstmtFld.setAsciiStream(1, dataStream, -1); // This method is not implemented
如何在预处理语句中使用setAsciiStream?
我是否正确地使用了setAsciiStream
?
这是控制台中的错误消息。
Attempting connection to Teradata with FastLoadCSV.
Connection to Teradata with FastLoadCSV established.
Creating a PreparedStatement object with FastLoadCSV.
Created a PreparedStatement object with FastLoadCSV.
Checking connection for warnings
Streaming FastLoad1.csv
SQL State = HY000, Error Code = 1151
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1151] [SQLState HY000] A failure occurred while setting a parameter value for database table "xxxxxxxxx"."my_table". Details of the failure can be found in the exception chain that is accessible with getNextException.
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:68)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1366)
at T20208JD.main(T20208JD.java:160)
SQL State = HY000, Error Code = 1155
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1155] [SQLState HY000] The next failure(s) in the exception chain occurred in FastLoadPreparedStatement[0] of 16 FastLoadPreparedStatement(s).
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:73)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:101)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1361)
at T20208JD.main(T20208JD.java:160)
SQL State = HY000, Error Code = 1093
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1093] [SQLState HY000] This method is not implemented
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:63)
at com.teradata.jdbc.jdbc.fastload.FastLoadPreparedStatement.setAsciiStream(FastLoadPreparedStatement.java:759)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1359)
at T20208JD.main(T20208JD.java:160)
SQL State = HY000, Error Code = 1151
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1151] [SQLState HY000] A failure occurred while setting a parameter value for database table "xxxxxxxx"."my_table". Details of the failure can be found in the exception chain that is accessible with getNextException.
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:68)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1366)
at T20208JD.main(T20208JD.java:160)
SQL State = HY000, Error Code = 1155
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1155] [SQLState HY000] The next failure(s) in the exception chain occurred in FastLoadPreparedStatement[0] of 16 FastLoadPreparedStatement(s).
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:73)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:101)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1361)
at T20208JD.main(T20208JD.java:160)
SQL State = HY000, Error Code = 1093
com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata JDBC Driver] [TeraJDBC 14.10.00.17] [Error 1093] [SQLState HY000] This method is not implemented
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:93)
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDriverJDBCException(ErrorFactory.java:63)
at com.teradata.jdbc.jdbc.fastload.FastLoadPreparedStatement.setAsciiStream(FastLoadPreparedStatement.java:759)
at com.teradata.jdbc.jdbc.fastload.FastLoadManagerPreparedStatement.setAsciiStream(FastLoadManagerPreparedStatement.java:1359)
at T20208JD.main(T20208JD.java:160)
Exception in thread "main" java.lang.IllegalStateException: Sample failed.
at T20208JD.main(T20208JD.java:336)
pstmtFld.setAsciiStream(1, dataStream, -1);
抛出了一个错误。 - BuraspstmtFld.setAsciiStream(1, dataStream . .
,尽管他们有三个字段。这是一个官方网站,所以我怀疑他们是否有错别字 http://developer.teradata.com/doc/connectivity/jdbc/reference/current/samp/T20208JD.java.txt - Buras