Import data from MS Excel using Java source code

I want to import data placed in MS Excel and print it using the Java Application Program. I am new to Java. Therefore, please tell us if this is possible.

If so, how? Any website / tutorial will be very helpful.

Thanks in advance.

+3
source share
5 answers

You can use the POI library to read from excel files

+4
source

You can use jexcel API. They are pretty simple. http://jexcelapi.sourceforge.net/

I also think that Apache POI is also working on this area.

+3
source
+1

Why not export it from Excel in some format that is not property? If the data is not too complicated, even CSV can do the trick.

0
source

This JSP page connects an Excel worksheet to a database.

.<%@ page import="java.sql.*" %><br/>
.<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>

<BODY>               

.<%
  Connection con=DriverManager.getConnection("jdbc:odbc:DsnName");<br/>
  Statement stm=con.createStatement();<br/>
  ResultSet rs=stm.executeQuery("select * from [Sheet1$]");       
%>

.<% if(!rs.next()) {
    out.println("Sorry, could not find data");
 }
 else { %>
  .<%=rs.getString(1)%>
.<%}%>

</BODY>

0
source

Source: https://habr.com/ru/post/1704060/


All Articles