Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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: 7236
169
  • 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.
 
Sheriff
Posts: 26966
84
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic