aspose file tools*
The moose likes JDBC and the fly likes Data from database not being displayed in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Data from database not being displayed in JSP" Watch "Data from database not being displayed in JSP" New topic
Author

Data from database not being displayed in JSP

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056

I showed this code to one of my collegue who is a software engineer..the database connection , the table the data in it all are correct, but he also was not able to trace the issue as of why data is not being displayed in the jsp page below is the code....



http://www.lifesbizzare.blogspot.com || OCJP:81%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

If this Java code was in a class, rather than following the really bad practice of placing it in a JSP, it'd be a lot easier to debug and test. That's the first step I'd take.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1056

I Debugged this in netbeans and i got this below message
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18988
    
    8

I don't even think that should compile. Line 25, for example, isn't valid Java code.

But that's just one of the things you have to deal with when you use scriptlets. If you had put that code in a Java class, where it belongs, you would have tried to compile it and found out right away that there was bad code in it. But when you put it in a JSP, you get messages in a log file, and you might get an error page depending on whether you configured an error page into your application. Which you probably didn't.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Data from database not being displayed in JSP