Advertisement

08.20.2007 at 09:02PM PDT, ID: 22775853
[x]
Attachment Details

what is wrong with this sql:update statement?

Asked by richardsimnett in Java Standard Tag Library (JSTL) & Server Tags, Java Server Pages (JSP)

Tags: suitable, driver, update, statement

Hello,
What is wrong with my sql:update statement? I keep getting the following error:

exception

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

55:                    
56:                     <%-- insert the new job into the database --%>
57:                     <sql:setDataSource var="insjob" url="jdbc:mysql://192.168.1.4/pdev" driver="com.mysql.jdbc.Driver" user="pdev" password="pdev2k7"/>
58:                     <sql:update var="insJob" dataSource="insjob">
59:                         INSERT INTO jobs (jobname,listcount,listname)
60:                         VALUES ('${jobname}',${linecount},'listname');
61:                     </sql:update>


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: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for insjob"
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
      org.apache.jsp.manager_jsp._jspService(manager_jsp.java:266)
      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

javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver found for insjob"
      org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.getConnection(UpdateTagSupport.java:235)
      org.apache.taglibs.standard.tag.common.sql.UpdateTagSupport.doStartTag(UpdateTagSupport.java:115)
      org.apache.jsp.manager_jsp._jspx_meth_sql_update_0(manager_jsp.java:719)
      org.apache.jsp.manager_jsp._jspService(manager_jsp.java:189)
      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)



It says it cant find a suitable driver, but I have already added the driver to the lib in my project, and to the classpath. its the standard mysql 5.0 jdbc driver... the other thing thats weird is I use this exact same driver in another set of queries on this same application and it works just fine!

How do I correct this?

Working fix worth 500 points.

Thanks,
RickStart Free Trial
 
Loading Advertisement...
 
[+][-]08.21.2007 at 09:33AM PDT, ID: 19739302

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Standard Tag Library (JSTL) & Server Tags, Java Server Pages (JSP)
Tags: suitable, driver, update, statement
Sign Up Now!
Solution Provided By: mrcoffee365
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.21.2007 at 10:50AM PDT, ID: 19739931

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2007 at 11:23AM PDT, ID: 19740190

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628