Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old November 13th, 2012, 09:18 AM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,828 bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 6 Days 11 h 21 m 4 sec
Reputation Power: 1248
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
Quote:
Originally Posted by nicholas.omosa
yes i do


In this part of your code

Code:
FileOutputStream fileOut = new FileOutputStream("c:\\excelFile.xls");
wb.write(fileOut);
fileOut.close();
out.println("Data is saved in excel file.");
con.close();
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
}
}


did you also put a print statement in the catch block?

Reply With Quote
  #17  
Old November 13th, 2012, 09:22 AM
nicholas.omosa nicholas.omosa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 34 nicholas.omosa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 44 m 5 sec
Reputation Power: 1
Quote:
Originally Posted by bullet
In this part of your code

Code:
FileOutputStream fileOut = new FileOutputStream("c:\\excelFile.xls");
wb.write(fileOut);
fileOut.close();
out.println("Data is saved in excel file.");
con.close();
conn.close();
System.out.println("Disconnected from database");
} catch (Exception e) {
}
}


did you also put a print statement in the catch block?



i dont think i did how do you do that ?

Reply With Quote
  #18  
Old November 13th, 2012, 09:24 AM
stdunbar's Avatar
stdunbar stdunbar is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 2,399 stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level)stdunbar User rank is General 10th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 18 h 26 m 27 sec
Reputation Power: 1660
Send a message via Yahoo to stdunbar Send a message via Google Talk to stdunbar
I don't understand your issue. In the code you show you're doing nothing but getting a database connection. If you want some output then you have to actually output something. I would totally expect a blank page from the code you showed.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #19  
Old November 13th, 2012, 09:35 AM
nicholas.omosa nicholas.omosa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 34 nicholas.omosa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 44 m 5 sec
Reputation Power: 1
Quote:
Originally Posted by stdunbar
I don't understand your issue. In the code you show you're doing nothing but getting a database connection. If you want some output then you have to actually output something. I would totally expect a blank page from the code you showed.


good, now i think we are on the same page..so how do i get the output?

Reply With Quote
  #20  
Old November 13th, 2012, 09:37 AM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,828 bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 6 Days 11 h 21 m 4 sec
Reputation Power: 1248
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
Quote:
Originally Posted by nicholas.omosa
good, now i think we are on the same page..so how do i get the output?


I'm confused. I was under the impression that you were demonstrating in the post with the smaller amount of code that you had modified the original servlet so you could display the exceptions. Did you only have the new code as the servlet? In that case, I agree with stdunbar that it won't do anything.

Reply With Quote
  #21  
Old November 13th, 2012, 09:40 AM
nicholas.omosa nicholas.omosa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 34 nicholas.omosa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 44 m 5 sec
Reputation Power: 1
Quote:
Originally Posted by bullet
I'm confused. I was under the impression that you were demonstrating in the post with the smaller amount of code that you had modified the original servlet so you could display the exceptions. Did you only have the new code as the servlet? In that case, I agree with stdunbar that it won't do anything.


ok bullet and stdunbar..how do i print the output put of my query?

Reply With Quote
  #22  
Old November 13th, 2012, 09:43 AM
bullet's Avatar
bullet bullet is offline
Java Junkie
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jan 2004
Location: Mobile, Alabama
Posts: 3,828 bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level)bullet User rank is General 4th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 6 Days 11 h 21 m 4 sec
Reputation Power: 1248
Send a message via ICQ to bullet Send a message via AIM to bullet Send a message via MSN to bullet
Quote:
Originally Posted by nicholas.omosa
ok bullet and stdunbar..how do i print the output put of my query?


If you use a simple System.out.println it should show up in the log file or if you use out.println it should show up on the screen. (Assuming you have create a PrintWriter called out.)
Comments on this post
stdunbar agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > How to export data from servlet to excel file through poi lib

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap