Hi,
Like the title says I am having a little difficulty connecting a JSP page to database.Here is my code containing the setDataSource, I am pretty sure that this is whats causing the problem.
<%@ taglib prefix="sql" uri="htpp:/java.sn.com/jsp/jstl/sql" %>
<sql:setDataSource
var = "labdb"
scope = "session"
driver = "sun.jdbc.odbc.JdbcOdbcDriver"
url = "jdbc:odbc:labdb"
/>
<sql:query var="userList" scope="request" dataSource = "${labdb}">
SELECT * FROM User
WHERE FirstName Like ?
AND LastName Like ?
AND Department LIKE ?
ORDER BY LastName
<sql:param value="%${param.firstName}%" />
<sql:param value="%${param.lastName}%" />
<sql:param value="%${param.password}%" />
</sql:query>
<jsp:forward page="list.jsp" />
My database is called labdb, and I am using windows 7.I a trying to make my connection by :
- going to control panel ->Data Sources(ODBC)
- Adding a new db, called labdb
This is where I am running into some confusion.Should I just type in the DSN name, or use the filepath where I have stored my database.
I have tried both ways and nothing seems to work, I would appreciate any help however little very much.
Thank you.