I have a problem with my EJB application.
I use JBOSS, JSQLConnect driver(from NETDIRECT) and an MS SQL server.
The create() method works fine (it inserts an record into the
database), but the finder methods seems not to work.

Here is an example of such a method. The ResultSet returned is empty and
it should not be.
If I use Statement in place of PreparedStatement the ResultSet is the
empty too.


public Enumeration ejbFindAll() throws FinderException{
      Connection con=null;
      PreparedStatement ps=null;
      ResultSet rs=null;
      try{
           con=this.getConnection();
           ps=con.prepareStatement("Select Nume From Items");
           rs=ps.executeQuery();
           String nume;
           Vector keys=new Vector();
           rs.first();
           while(rs.next()){
             keys.addElement(new PhpPK(rs.getString(1)));
           }
           if(rs!=null) rs.close();
           if(ps!=null)ps.close();
           if(con!=null)con.close();

           return keys.elements();
         }

     catch(SQLException se){
         System.out.println("SQLException:"+se.getMessage());
         throw new EJBException(se);
        }

    }

Thanks!
Sorin

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to