• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error coming 500 please an code is

 
Ronak Trivedi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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]
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Tim Moores
Bartender
Posts: 2946
46
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic