aspose file tools*
The moose likes JDBC and the fly likes problem while connecting jsp form with sql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem while connecting jsp form with sql" Watch "problem while connecting jsp form with sql" New topic
Author

problem while connecting jsp form with sql

Omkar G. Deshmukh
Ranch Hand

Joined: Sep 21, 2012
Posts: 40
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /empregdb.jsp:58

55: pst1.setString(19,est);
56: pst1.setString(20,ecn);
57:
58: pst1.executeUpdate();
59: pst1.close();
60:
61:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause

javax.servlet.ServletException: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.empregdb_jsp._jspService(empregdb_jsp.java:122)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause

java.sql.SQLException: [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to numeric.
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
sun.jdbc.odbc.JdbcOdbc.SQLExecute(JdbcOdbc.java:3149)
sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(JdbcOdbcPreparedStatement.java:216)
sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeUpdate(JdbcOdbcPreparedStatement.java:138)
org.apache.jsp.empregdb_jsp._jspService(empregdb_jsp.java:101)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

Apache Tomcat/5.5.17
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2885
    
  13

Welcome to JavaRanch, Omkar.
If you were perhaps meant to ask why that exception was thrown, as what the root cause says, there is a datatype mismatch between the database entity and the values you are trying to pass.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
My Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem while connecting jsp form with sql
 
Similar Threads
Problem connecting with MySQL using JSP
Hibernate: Error getting property 'lastItem'
Problem connecting with MySQL using JSP
Struts validation problem
javax.servlet.ServletException: Name java: is not bound in this Context