Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[U]Problem retrieving values from a database in a seating arrangement web application

 
Sridhar Venkataraman
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm going to spill all the beans here so that the post is as informative as possible.

I am building a JSP application which is supposed to dynamically render floor plans. This basically means that I read some coordinates off of a database and place corresponding pictures in the pages that render so the pictures make up a floor plan.

I started off by making the first page, which is index.jsp. This page asks the user to select a floor. The dropdown list is populated with values from a database which holds the configured floor numbers in a table. The code for this page is here


All requests in the app are handled by a servlet named SeatPlanRequestServlet.java


I have checked and rechecked the database queries that I am using to find out these values, and they work correctly in the mySQL query browser. The "floorselected" parameter is also being set and passed successfully. There are no exceptions being thrown anywhere by any of the code which deals with the database.

I tried replacing the datamanager method calls with hardcoded values, and I still get the same result. This means that somehow the calls to datamanager are not producing the expected results, and I don't know why because the very same datamanager works fine when invoked in the index.jsp page.

All the database properties are set in the web.xml file, and they work because I was successfully able to populate the drop down list in the index.jsp page with floor numbers that were obtained by querying the database.

I am stuck with this error and cannot proceed with this application. I'd greatly appreciate some guidance on why this is happening. If any more information is needed, I'd be more than happy to provide it.

Thanks all for your patience in reading this. If the error seems amateurish, I beg your pardon because I'm a novice.

[ January 13, 2008: Message edited by: Sridhar Venkataraman ]

[ January 13, 2008: Message edited by: Sridhar Venkataraman ]

[ January 13, 2008: Message edited by: Bear Bibeault ]

[ January 13, 2008: Message edited by: Sridhar Venkataraman ]

[ January 15, 2008: Message edited by: Sridhar Venkataraman ]
[ January 15, 2008: Message edited by: Sridhar Venkataraman ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sridhar,
While I'm sure this post does contain all the information, it actually contains too much information. On my computer, it is 17 screens long. This is a lot to ask a volunteer to read to get to the bottom of the problem.

If you don't get any replies, here's a bit of advice: try to come up with a smaller version of the app that demonstrates the same problem. For example, "I call the following sql/JDBC code with these parameters and it returns an unexpected value" or "the following JSP doesn't pass the expected parameters to my servlet."

This will help you isolate the problem (which you may have done - I didn't read the whole 17 screens), provide initial debugging steps and give a manageable chunk of problem to readers.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to paring down the problem to as few lines as demonstrate the issue (please read this for more information.), please be sure to take the time to compose descriptive subjects for your posts; read this for more information. " A problem that's puzzling me" could be anything!
[ January 13, 2008: Message edited by: Bear Bibeault ]
 
Sridhar Venkataraman
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I normally do keep things as short as possible. However, in this app there are so many linkages that I will invariably get people asking me questions about what a particular class/page does, or elaborate on the code for a page etc.

It did look ugly to me even

Let me do something to make the topic much more readable. Let me outsource the code and link it up here. The official java forums have a scrolling mechanism for code posts, which is why I linked to a topic I started there in a prior thread. But that was disallowed.

[ January 13, 2008: Message edited by: Sridhar Venkataraman ]
[ January 13, 2008: Message edited by: Sridhar Venkataraman ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic