Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

give me a java code snippet to connect Microsoft excel
through.... I am trying alot... plz help me.

Answer Posted / r.salimulla baba

import java.util.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Connect extends HttpServlet
{
public void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Connection con=null;
Statement st=null;
PreparedStatement pst=null;
ResultSet rs;
try
{
Class.forName
("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection
("jdbc:odbc:Std","","");
st=con.createStatement();
rs=st.executeQuery("select * from
[ExcelSheetName$]");
while(rs.next())
{
out.println(rs.getString
(1));
out.println(rs.getString
(2));
out.println(rs.getString
(3));
}
}
catch(Exception e)
{
System.out.println("Errr :"+e);
}
}
}

Is This Answer Correct ?    15 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is jdbc in dbms?

961


what happen if we set JDBC string to NULL?

3344


What do you understand by jdbc statements?

976


What is metadata in jdbc?

933


What is the function of drivermanager class?

1048


If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?

945


What does it mean to "materialize" data?

934


How do you determine the sensitivity of the ResultSet object?

929


What is jdbc? Describe the steps needed to execute a sql query using jdbc.

858


What is the function of setautocommit?

1162


What are the types of jdbc drivers that exist?

957


What is jdbc odbc driver?

991


How does a custom RowSetReader get called from a CachedRowSet?

1030


What are the considerations for deciding on transaction boundaries?

960


What are devices?

906