Connecting Tomcat to MSsql
843836Jan 16 2004 — edited Jan 16 2004I am new to this and am having trouble connecting to a MSSQL database. I am getting the following error message...
org.apache.jasper.JasperException: /pizza.jsp(11,0) According to TLD or attribute directive in tag file, attribute dataSource does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
etc..
Has anybody seen this before?
I have downloaded j2sdk1.4.2_03, Tomcat 5.0 and the JSTL and have run a few simple examples like passing data from one page to another which are fine so I know the server is running ok - I think.
I have also downloaded the SQL Server 2000 Driver for JDBC and put the 3 .jar files into the lib directory of my application.
I have a test database called Orders on the same machine that I have Tomcat etc and the username and password are correct.
The top of the jsp page is as follows:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<sql:setDataSource var="mdb" scope="application"
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver" url="jdbc:microsoft:sqlserver://localhost/Orders:1433"
user="username" password="password" />
<sql:query var="ordersx" dataSource="${mdb}">
select * from Orders
</sql:query>
I am not sure what I have done wrong but I am hoping it is something very obvious.
Thanks
Sarah