
Hi every body iam doing school project iam using backend as oracle front end java .how to print student marks list /attendence in pdf format. please help me. thanks in advance.

Here is a code that will store the database data into pdf table. We have used itext api:
<%@page import="java.io.*"%>
<%@page import="java.sql.*"%>
<%@page import="com.lowagie.text.*"%>
<%@page import=" com.lowagie.text.pdf.*"%>
<%
Document document=new Document();
PdfWriter.getInstance(document,new FileOutputStream("C:/data.pdf"));
document.open();
PdfPTable table=new PdfPTable(2);
table.addCell("Name");
table.addCell("Address");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("Select * from data");
while(rs.next()){
table.addCell(rs.getString("name"));
table.addCell(rs.getString("address"));
}
document.add(table);
document.close();
%>

thanks alot

hey bro, need little help in this. it prints all records in pdf. i want only the displayed results from resultset to be printed in pdf...ofcourse there will be "where" clause in sql query ..but am not getting as how should i use that where clause in sql. please help ASAP! thanks in advance.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.