954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

extra bytes at the end of file

I m trying to connect MYSQL 4.1.1 from JSP using java. and I m getting error as described below.

javax.servlet.ServletException: Extra bytes at the end of class file org/gjt/mm/mysql/Driver
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Login100408_jsp._jspService(Login100408_jsp.java:697)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

plz help me I m not getting any solution.

punitdam
Light Poster
32 posts since May 2008
Reputation Points: 12
Solved Threads: 3
 

That is a legacy Driver. It is only around for backwords compatability. Use com.jdbc.mysql.Driver instead.

P.S. No need to change your jarfile (depending on the version of course), just change the String in the Class.forName() or Driver.registerDriver() method call.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

its working now thanks.

punitdam
Light Poster
32 posts since May 2008
Reputation Points: 12
Solved Threads: 3
 

One thing you should also be aware of, database connection from JSP is out of date. Now JSP is used for presentation purposes (user input, or system data presentation for user) and servlet handle logic, which includes DB connectivity

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You