File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP x MSSQL SERVER? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP x MSSQL SERVER? " Watch "JSP x MSSQL SERVER? " New topic



Joined: May 09, 2002
Posts: 1
any one can help-me?
<%@ page import="java.sql. *" %>
<jsp:useBean id="item" class="ItemBean">
private Connection conexao = null;
private Statement declaracao = null;
private ResultSet resultado = null;
private String pesquisa = null;
private String atualiza = null;
ItemBean item = new ItemBean ();
try {
String query = "SELECT Pcp_Codigo FROM PC WHERE Pcp_Codigo in ('10000','10001')";
conexao = DriverManager.getConnection("jdbc dbc:SERVIDOR02:1433?database=NomedoBanco","NomedaTabela","PSW");
declaracao = conexao.createStatement();
resultado = declaracao.executeQuery(query);
if ({
catch (ClassNotFoundException e){
System.err.println ("Nao funfou driver");
catch (SQLException e){
System.err.println ("Nao funfou banco");
finally {
try{ if (conexao != null) conexao.close() ;}
catch (SQLException e) { }

<HTML><HEAD><TITLE> New Document </TITLE></HEAD>
<jsp:getProperty name="item" property="id"/>

ERROR ------------>

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
org.apache.jasper.JasperException: ItemBean
root cause
java.lang.ClassNotFoundException: ItemBean
Brian Glodde
Ranch Hand

Joined: Jun 27, 2001
Posts: 171
Your bean is not found! Is it in a package? If so you'll need to prefix the tag accordingly.
You'll also need to change your name, JavaRanch
has a naming convention, described at
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Thanks, Brian.
Please change your "Publicly Displayed Name" by modifying your Profile after reviewing the guidelines at
Assuming you will do that, I am answering your qstn. Please cooperate.
<jsp:useBean id="item" class="ItemBean">

It is not a good practice to put beans without a package. If you do this then the App server will look for the bean in the same package that your generated Servlet code is. Obviously, that fails.
Also, you are NOT using the useBean tag correctly.
<jsp:useBean ...>
[ code ]

Take a Minute, Donate an Hour, Change a Life
I agree. Here's the link:
subject: JSP x MSSQL SERVER?
It's not a secret anymore!