Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2003, 08:53 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default suitable mysql driver

Hi, I'm facing some difficulties in connecting my examples in Beginning JSP chapter 03 (Data Access).The error message are:
-->Unable to locate suitable driver.

For your info, I included all the jar files as intructed in the book (mysql-connector-java-2.0.14-bin.jar also included).

Its funny when i tried NON-JSTL codes to connect to mysql, it seems to be ok and and it produce the same results. The non-JSTL code are as follows :

<%@ page import="java.sql.*" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/publish/user=;password=";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>
<html><body>
<table border=1>
  <tr>
    <td>ID</td><td>Title</td><td>Price</td>
  </tr>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance ();
connection = DriverManager.getConnection(connectionURL, "publish", "wrox");
statement = connection.createStatement();
rs = statement.executeQuery("SELECT * FROM book");
%>
<%
while (rs.next()) {
out.println("<tr>");
out.println(" <td>" + rs.getString("ID")+"</td>");
out.println(" <td>" + rs.getString("title")+"</td>");
out.println(" <td>" + rs.getString("price")+"</td>");
out.println("</tr>");
}
rs.close();
%>
</table>
</body></html>

In order to use the JSTL code in chapter03 examples, do i have to make some entries in web.xml?

Thanks
 
Old July 30th, 2003, 04:03 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't know what happen. But when i use JWSDP which include Tomcat 5.0. All examples went well with it including in my previous message.
 
Old July 31st, 2003, 09:18 PM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
what is "JWSDP"?

thanks

 
Old August 1st, 2003, 12:32 AM
Authorized User
 
Join Date: May 2003
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Fire Logic JWSDP is Java Web Services Developement Pack this contains API's for building Java Based web services.

Regards


Yashraj Chauhan
Java\J2EE Specialist
Wiley Support Team





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLException no suitable driver zhuchunlai Apache Tomcat 2 November 29th, 2007 10:51 AM
Reducing code lines with suitable method john316 C# 2005 7 September 21st, 2007 10:43 AM
Cannot load JDBC driver class with com.mysql.jdbc. dzis Apache Tomcat 0 January 29th, 2004 11:57 AM
Cannot load JDBC driver class with com.mysql.jdbc. dzis MySQL 0 January 29th, 2004 11:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.