aspose file tools
The moose likes JSP and the fly likes JSP Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

JSP Error

raji navaneethan

Joined: Apr 06, 2006
Posts: 15
// My JSP coding. This is stored in the following path ]http://localhost:8080/vennila/test.jsp
<HEAD><TITLE>DataBase Search</TITLE></HEAD>

<%@ page language="Java" import="java.sql.*" %>
<jsp:useBean id="db" scope="application" class="SQLBean.DbBean"/>
<jsp:setProperty name="db" property="*" />

ResultSet rs = null ;
ResultSetMetaData rsmd = null ;
int numColumns ;
int i;
<h2> Results from </h2>
rs = db.execSQL("select * from emp1");
i = db.updateSQL("UPDATE emp1 set fname = 'hello world' where

rsmd = rs.getMetaData();
numColumns = rsmd.getColumnCount();
for(int column=1; column <= numColumns; column++)

<%= rs.getString("empid") %>

//My Java Package Coding. It is compiled and stored in the following path: C:\Program Files\Apache Tomcat 4.0\webapps\vennila\WEB-INF\classes\
package SQLBean;

import java.sql.*;

public class DbBean {

String dbURL = "sun.jdbc.odbc.JdbcOdbcDriver";
String dbDriver = "'jdbc dbc:emp','',''";
private Connection dbCon;

public DbBean(){

public boolean connect() throws ClassNotFoundException,SQLException{
dbCon = DriverManager.getConnection(dbURL);
return true;

public void close() throws SQLException{

public ResultSet execSQL(String sql) throws SQLException{

Statement s = dbCon.createStatement();
ResultSet r = s.executeQuery(sql);
return (r == null) ? null : r;

public int updateSQL(String sql) throws SQLException{
Statement s = dbCon.createStatement();
int r = s.executeUpdate(sql);
return (r == 0) ? 0 : r;


----------------- xxxx-------------------------

When i run the jsp in internet explorer its giving me the following error :

C:\Program Files\Apache Tomcat 4.0 work\localhost\vennila\test$ Class SQLBean.DbBean not found.
SQLBean.DbBean db = null;

My Java file is stored in the following path : C:\Program Files\Apache Tomcat 4.0\webapps\vennila\WEB-INF\classes

My Class file is stored in the following path :
C:\Program Files\Apache Tomcat 4.0\webapps\vennila\WEB-INF\classes\SQLBean

I am breaking my head towards this problem for the past 4 days. I am new to Bean concept. kindly help me to solve this problem.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 62312

Please stop posting the same question multiple times.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
subject: JSP Error