Hi,

I'm using tomcat5.5.2 and mysql5.0.27 and Connector/J 5.0.
i'm doing the same thing as http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html and i got this error.

i'm using fedora 5 and i download "Linux (non RPM package) downloads /linux (x86)" of mysql and install it accoding to the insturction. I created a databse P6120 and table test2 by using user 'eric' and passwod 'ericyin1'.

I add the following to server.xml:
<Context path="/DBTest" docBase="DBTest"
       debug="5" reloadable="true" crossContext="true">
 <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
              maxActive="100" maxIdle="30" maxWait="10000"
username="eric" password="ericyin1" driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/p6120?autoReconnect=true"/>

</Context>

I add the following to web.xml:
 <resource-ref>
     <description>DB Connection</description>
     <res-ref-name>jdbc/TestDB</res-ref-name>
     <res-type>javax.sql.DataSource</res-type>
     <res-auth>Container</res-auth>
 </resource-ref>

I add the following to the index.jsp:
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<sql:query var="rs" dataSource="jdbc/TestDB">
select id, name, studentid  from test2
</sql:query>


<c:forEach var="row" items="${rs.rows}">
   name ${row.name}<br/>
   studentid ${row.studentid}<br/>
</c:forEach>

thanks,

Eric.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to