3

I want to Import data placed in MS Excel and print it using Java Application Program. I am newbie in Java. So Please guide, is it possible.

If yes, how? Any website/tutorial will be of great help..

Thanks in advance..

5 Answers 5

4

You can use the POI library for reading from excel files

Sign up to request clarification or add additional context in comments.

1 Comment

We use POI as well in our shop, it's quirky, but it gets the job done.
3

You can use the jexcel APIs. They're quite simple overall. http://jexcelapi.sourceforge.net/

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

Comments

1

Here is an article on using JDBC using Excel as a data source

1 Comment

Also, one more thing. This kind of connectivity will work only when u are using single PC.. But when you need to design a web-based application i.e. using Servlets or JSP than these settings won't work?? Does there exist any Java package? Please forward that...
0

Why not export it from Excel in some format that is not proprietary? If the data is not too complex, even CSV might do the trick.

Comments

0

This JSP page connects the Excel sheet to the 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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.