aspose file tools*
The moose likes JDBC and the fly likes Error coming 500 please an code is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Error coming 500 please an code is" Watch "Error coming 500 please an code is" New topic
Author

Error coming 500 please an code is

Ronak Trivedi
Greenhorn

Joined: Feb 23, 2012
Posts: 6


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

Joined: Apr 06, 2010
Posts: 4422
    
    8

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

Joined: Feb 23, 2012
Posts: 6
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
Rancher

Joined: Sep 21, 2011
Posts: 2408
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
Bartender

Joined: Oct 14, 2005
Posts: 18674
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error coming 500 please an code is