JSTL "<sql:query tag problem [message #23190] |
Fri, 14 May 2004 16:53 |
Eclipse User |
|
|
|
Originally posted by: bbozek.email.hinet.hr
I have problem with getting data from database using JSTL on my JSP page.
After trying to get data using "<sql:query" tag (see complete code), I get
following message:
javax.servlet.ServletException: Unable to get connection, DataSource
invalid: "java.sql.SQLException: No suitable driver".
************************************************************ ***********
<!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
<%@ page language="java" autoFlush="false" pageEncoding="UTF-8"
import="java.sql.*" %>
<%@ taglib uri="/WEB-INF/sql.tld" prefix="sql" %>
<sql:setDataSource var="datasource"
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EppCM"
user="test"
password="test" />
<sql:query var="books" dataSource="${datasource}">
SELECT * FROM EPP_CM
</sql:query>
<html>
<head>
<title>Welcome</title>
</head>
<body>
<h1><center>Test</center></h1>
</body>
</html>
************************************************************ *************
My other code working just fine:
************************************************************ *****
<!-- connection -->
<sql:connection id="conn1">
<sql:url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=EppCM
</sql:url>
<sql:driver>com.microsoft.jdbc.sqlserver.SQLServerDriver</sql:driver >
<sql:userId>test</sql:userId>
<sql:password>test</sql:password>
</sql:connection>
<sql:preparedStatement id="stmt0" conn="conn1">
<sql:query>
SELECT * FROM EPP_CM
</sql:query>
<sql:resultSet id="rset0">..........
************************************************************ ******
Using this kind of retrieving data on JSP page looks quit good for me.
Thaks
|
|
|
|
Powered by
FUDForum. Page generated in 0.03447 seconds