File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Load Data Infile Issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Load Data Infile Issues" Watch "Load Data Infile Issues" New topic

Load Data Infile Issues

Jesse Kelm

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(

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

Jesse Kelm

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:
subject: Load Data Infile Issues
It's not a secret anymore!