I want to import an Excel file into a MySQL database using an ODBC driver. Does Java support this technique? If yes, please guide me on how to implement this.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can read an Excel file in Java using the Apache POI library: http://poi.apache.org/
There are some code samples on their howto page which will tell you how to read an Excel file: http://poi.apache.org/spreadsheet/how-to.html
To store the data it would be better for you to use the JDBC driver for MySQL rather than ODBC since ODBC relies on native libraries. You can get the connector here: http://www.mysql.com/products/connector/
If you absolutely must use ODBC, then you can see how to do that here: http://download.oracle.com/javase/1.5.0/docs/guide/jdbc/bridge.html