Ah thnx.. but I've got 1 question about that, and a new problem.. :)
If you use capital M, then where is this needed for?
<jsp:useBean id="medewerkerBean" scope="page" class="MedewerkerBean" />
and my new problem:
I get the error: "Object has been closed". This is when I use the same
JSP-page and the 2 following classes:
What is it what I'm doing wrong?
Bye,
Jasper de Barbanson
public class MedewerkerBean
{ (unimportant code)
public Vector findMedewerker(String SP_Name) throws SQLException,
ClassNotFoundException
{
ResultSet rs = null;
Database db = new Database();
rs = db.RunSPReturnRSNoParam(SP_Name);
Vector res = new Vector();
try
{
while (rs.next())
{
MedewerkerBean mb = new MedewerkerBean();
mb.setPersoneelsnummer(rs.getInt(1));
mb.setVoornaam(rs.getString(2));
mb.setAchternaam(rs.getString(3));
mb.setAdres(rs.getString(4));
mb.setPostcode(rs.getString(5));
mb.setWoonplaats(rs.getString(6));
mb.setGebdatum(rs.getString(7));
mb.setTelnummer(rs.getString(8));
mb.setEmail(rs.getString(9));
res.addElement(mb);
}
}
catch (SQLException e)
{
throw e;
}
return res;
}
}
public class Database
{
private String driver =
"com.merant.datadirect.jdbc.sqlserver.SQLServerDriver";
private String protocol = "jdbc:sqlserver://taco:1433";
private String username = "TestAccount";
private String password = "TestPassword";
public ResultSet RunSPReturnRSNoParam(String SPName) throws SQLException
{
PreparedStatement ps = null;
ResultSet rs = null;
Connection connection = null;
try
{
Class.forName(driver);
}
catch(ClassNotFoundException e) {}
try
{
connection = DriverManager.getConnection(protocol, username,
password);
ps = connection.prepareStatement(SPName);
rs = ps.executeQuery();
}
catch (SQLException sqle) {}
finally
{
if (connection != null)
{
try
{
connection.close();
}
catch (SQLException sqle) {}
}
}
return rs;
}
}
----- Original Message -----
From: Witherow, Paul <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 04, 2001 1:08 PM
Subject: Re: resultset & vector
> its not your classpath.
>
> you need a capital M for your declaration
>
> for (int i=0; i<size; i++)
> {
> medewerkerBean mwb = vect.elementAt(i);
> ^
> |
> |
> here
>
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets