• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error coming 500 please an code is

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


hello sir here this is the code for inputing salary and output display the payment slip but it give me error 500
first i am running administrator form


this is the administrator form i am inputing value and click on show button it cant show the slip please help me sir

[Added code tags - see UseCodeTags for details]
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two things spring to mind.

Firstly, telling us you're getting an "error 500" doesn't give us anything to go on - that could be anything. You need to give us more details of exactly what the error is, and the stack trace. That should be available in your logs if it's not actually being displayed on the page.

Secondly, all that Java code should be in a servlet, not in a JSP page. Using scriptlets is a very outdated practice, and one of the problems with it is that it makes it much harder to debug.

[This may or may not be a database issue, and if it isn't it would be much better off in a different forum - but I can't tell without details of what the error is.]
 
Ronak Trivedi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when i entering the empid uname and salary it cant go to the salary page it would be refresh the page sir please help me a boutthis code i want to display
 
Saloon Keeper
Posts: 7590
177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why isn't the "catch" handler in line 76 printing out the entire stack trace so that you'll know in which statement, exactly, the problem occurs?

As I pointed out earlier, your code is still wide open to SQL injection attacks. It would be irresponsible to put it into use. And looking at the syntax of the SELECT query, it seems broken; not sure what you're trying to do there, but that's likely a cause for problems.
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, the code does have the usual list of beginner faults. Uses JDBC-ODBC driver -- JSP with scriptlets -- Fails to use PreparedStatement -- Database connection not closed -- Inadequate error handling. Hopefully it's a school exercise from one of those places which, after you graduate, you start again and learn how things are really supposed to be done.
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic