File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Load Data Infile Issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Load Data Infile Issues" Watch "Load Data Infile Issues" New topic
Author

Load Data Infile Issues

Jesse Kelm
Greenhorn

Joined: Sep 06, 2011
Posts: 11
I am attempting to load data from a .txt file that is csv formatted into a MS Access Database. I tried doing this with the INSERT statemetnt with success, but the processing is very slow. When searching on how to speed it up, it was suggested that using LOAD DATA INFILE was much quicker. When attempting to do this I receive an error of an invalid SQL statement. Here is my code and error message:



java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
at ConnectDatabase.main(ConnectDatabase.java:41)


Thanks in advanced for any insight as to what might be wrong.


Jesse Kelm
Greenhorn

Joined: Sep 06, 2011
Posts: 11
Nm...I found out this won't work with MS Access. That is the issue.
Thanks Everyone!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Load Data Infile Issues
 
Similar Threads
DriverManager.getConnection() not working in runtime but working fine in debug mode of Eclipse
Syntax error in INSERT INTO statement
In Access,Oracle8i PE ResultSet is not scrolling
LOAD DATA INFILE problem
Code error