Posts

Showing posts from January, 2017

Export Data from Excel File to a table in Database.

How to read Excel file from java:❓❓ Use APACHE POI.  Refer online for Tutorials: http://www.tutorialspoint.com/apache_poi/ 1. Install Apache POI (useful for importing and exporting data from excel files) 2. Import necessary Packages required for database connection and reading data from the spread sheets. 3. JDBC is used to connect to database, create a table in the database for exporting data into it. 4. Setup a File Input Stream for reading a excel file in java. (For reading a excel file.) 5. Now get the instance of workbook and iterate all the rows in the sheet 6. Iterate every row and insert them in to database table. Code: (I have five fields in my excel file and i am exporting it to database.)         int d1=0;         String d2="",d3="",d4="",d5="";         try         {                      //Database Connection             // For Connection code refer online.         System.out.println("S