Hai, thanks for your time.actually i inserted ur coding in my program but file is not having any data.pls check my previous coding,and tell me where i have do modification and where i have to insert ur codings..pls help me.
<% FileOutputStream outfile; PrintStream p,p1; outfile= new FileOutputStream("d:\\temp\\error1.txt"); outfile= new FileOutputStream(filename); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbcdbc:pro","pro","pro"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from CSG where Module='7613-slot6' "); p = new PrintStream(outfile); p.println(" Module DateTime Allocated Memory Available Memory
You should tell us why your code is not working and what error message you receive when you execute the JSP page. But as a first guess I think you should close your Streams by calling p.close()and outfile.close(). And I would delete the PrintStream p1 variable because it is never used.
0x2B | ~0x2B
SCJD, SCJP 1.5, SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJA, IBM Test 150, 142, 700, 701, Oracle Test 1Z0-51
Joined: Jul 18, 2006
In My coding i m not getting any error.but i want to save my data according to user wish.But in my program i mention particular name for the file and location. For that i add this coomand ,then response.setContentType("text/plain"); response.setHeader("Content-Disposition", "attachment;filename=File1.txt"); i m getting plain text file,its not having any data in the corresponding selected location.what i have to do...pls guide me..