Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 23, 2012, 10:30:34 PM

Pages: [1]   Go Down
  Print  
Author Topic: JSTL/mysql throws UnsupportedOperationException  (Read 1648 times)
vish
Newbie
*
Offline Offline

Posts: 1


« on: August 27, 2003, 08:23:22 PM »

Can someone direct me on using JSTL with mysql?
 
The code that works on my local machine is generating following exception.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 java.lang.UnsupportedOperationException
 at
com.caucho.jstl.el.SqlSetDataSourceTag.doStartTag(SqlSetDataSourceTag.java:
 148)
 at _dev._jsp._jstlSQLTest__jsp._jspService(/dev/jsp/jstlSQLTest.jsp:19)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The code that generates the error is..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<sql:setDataSource var="ds" driver="org.gjt.mm.mysql.Driver"

~~~~~~~~~~~~~~~~~~~~~~

 I have  copied the jdbc driver (mysql-connector-java-3.0.8-stable-bin.jar)
into
 WEB-INF/lib directory. Also core/xml tags of jstl are working in my
environment.
 Thank you.
 vish
Logged
golfingwags
Newbie
*
Offline Offline

Posts: 1


« Reply #1 on: August 30, 2006, 05:33:52 AM »

I'm having the exact same error.

I'm thinking resin has a bug in version 2.1.x with the sql jstl tag.

Can anyone verify this or give us the solution on how to fix it?

Thanks
Steve
Logged
dhyton
Newbie
*
Offline Offline

Posts: 1


« Reply #2 on: August 28, 2008, 04:26:56 PM »

I am having the exact same issue my JSP code is included below. Anybody figure this out yet?
Code:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>

<sql:setDataSource  var="example"  driver="com.mysql.jdbc.Driver"  url="jdbc:mysql://localhost/XXXXX"
                    user="XXXXX"  password="XXXX"/>

<html>
  <head><title>Simple jsp page</title></head>
  <body>
  <table>
  <sql:query var="items"> SELECT * FROM NewsItems</sql:query>
  <c:forEach var="columnName" items="${items.columnNames}">  <th><c:out value="${columnName}"/></th></c:forEach>
  <c:forEach var="row" items="${items.rows}">
      <tr>    <c:forEach var="column" items="${row}">      <td><c:out value="${column.value}"/></td>    </c:forEach>  </tr></c:forEach>
  </table>
  </body>
</html>
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: