Question: Hiiii



Share on Google+Share on Google+

Ragini Shukla
2 Answer(s)      8 years ago
Posted in : Java Beginners
View Answers

August 22, 2008 at 2:16 PM

hai frnd..........
on clicking the print button goto a new jsp page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">;
<[email protected] language="java" contentType="text/html; charset=ISO-8859-1"
<[email protected] uri=""; prefix="c"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Application Developer">

<%@ page import="java.sql.*" %>
<%! Connection con;
ResultSet rst;
Statement st;
int a=0,no_of_pages=0,int count=o;
String url="jdbc:db2://url/database:";

System.out.println("After Establishing connection");
catch(ClassNotFoundException e)
System.out.println("ERROR!1: "+e);


<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFWorkbook"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFCell"%>
<%@ page import="org.apache.poi.hssf.usermodel.HSSFRow"%>
<%@ page import="*" %>
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("new sheet");
HSSFRow row = sheet.createRow((short)0);
HSSFCell cell = row.createCell((short)0);


System.out.println("Before Select");
rst=st.executeQuery("select * from tablename");
System.out.println("After select");

row.createCell((short)1).setCellValue(rst.getInt(1));//write according to ur column datatype
row.createCell((short)2).setCellValue(rst.getString(2));//write according to ur cloumn datatype.
//write the same command for how many columns u want to save in excel

FileOutputStream fileOut = new FileOutputStream
}catch ( Exception ex ){
<b>The Data is saved to Excel</b>

Thanks and Regards

[email protected]


Related Tutorials/Questions & Answers:
Servlet sending image  hiiii In my html page i use how to send this image value to servlet plz be inform me anybody
input using scanner and add/sub/mul/div of a matrix
input using scanner and add/sub/mul/div of a matrix  hiiii...... performe matrix add/sub/mul/div using scanner
Send Image Value to Servlet  hiiii In my html page i use input type=image src="" value="" name="" how to send this image value to servlet plz be inform me anybody
meenakshi  HIIII, Any one can help me,, I have created a form in jsp and bind it by using spring:bind in spring. I have use ModelAndView of SimpleFormController . But when i called onSubmit thn onSubmit not called
login data
login data  Hiiii Sir I am doing banking project on i have created database on sql and also created a connection to gui but m not getting the data after login i want to show particular data for particular user means if i
login data
login data   Hiiii Sir I am doing banking project on i have created database on sql and also created a connection to gui but m not getting the data after login i want to show particular data for particular user means
error in accessing database - JSP-Servlet
error in accessing database  hiiii im tanushri im tryng to connect my database to the servlet i hv succeeded in connectivity but im stuck to nother error called Got minus one from read call although i hv feeded data to my
error got minus one from read call - JSP-Servlet
error got minus one from read call  hiiii while connecting my servlet to database im getting error called java.sql.SQLException: Io exception: Got minus one from a read call oracle.jdbc.dbaccess.DBError.throwSqlException
Java Spring Hibernate Struts Training Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017 Java brief history Best Reasons to learn Java Java Example Codes and Tutorials in 2017 How do I read a large file quickly in Java? Is learning Java worthwhile? How to create first Java Program? Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include?


Advertisement null