I have an existing mysql install set up for php dev.
Server is localhost with db name fame
user is root with pass test
I have added localhost.localdomain to my hosts file
The code I am using is:
Code:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:setDataSource var="Source"
driver= "com.mysql.jdbc.Driver"
url= "jdbc:mysql://127.0.0.1/fame"
user= "root" password="test" />
<sql:query var="courses" dataSource="${Source}">
SELECT CourseNum,ShortDesc FROM coursenum
</sql:query>
The db fields are from my db instead of the test.
At first I was getting an error about not finding the driver for the connection. After a few hours on the net I found a mysql-connector-java.jar from the mysql site that I put in my WEB-INF/lib folder. Now I am getting a different error.
Quote:
quote:root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
|
I cannot seem to figure out why I can't get this to work and my goodness this is getting frustrating. I was stuck for a while because te jstl library files from the book have different taglib lines and now the mysql driver from jstl just won't work without all this extra hunting around. I am wondering does this much change in JSP in a year?
Thanks for the help.