Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » JSTL "<sql:query tag problem
JSTL "<sql:query tag problem [message #23190] Fri, 14 May 2004 16:53 Go to next message
Eclipse UserFriend
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
Re: JSTL "<sql:query tag problem [message #23269 is a reply to message #23190] Sat, 15 May 2004 02:22 Go to previous message
Eclipse UserFriend
Originally posted by: annix.sina.com

No suitable driver
Previous Topic:Web services in the WTP proposal
Next Topic:WTP proposal feedback: Commoditization
Goto Forum:
  


Current Time: Thu Dec 26 15:28:01 GMT 2024

Powered by FUDForum. Page generated in 0.03447 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top