/* ***************************************************************************** Copyright 2000 by Erica Andrews (cylikon@hotmail.com). All rights reserved. ./ButchWhipAppeal/ ./IcedPinky/ NO portion of this software may be used in ANY way by anyone other than myself without my express written consent. If it is downloaded for testing, it must be deleted from your system within 24 hours. Any other use constitutes piracy and fraudulent misuse of this software, punishable in a court of law. Copyright 2000 by Erica Andrews. All rights reserved. ***************************************************************************** */ package cylikon.ejb; import javax.ejb.*; import javax.naming.*; import java.rmi.*; import java.util.Properties; import java.util.Vector; public class JdbcEJBClient { Vector rs; public JdbcEJBClient() { } public static void main (String [] args) { JdbcEJBClient client = new JdbcEJBClient(); client.doQuery(); } public void doQuery() { try { System.out.print("Getting Initial Context..."); Properties p = new Properties(); p.put(Context.INITIAL_CONTEXT_FACTORY,"org.ejboss.naming.spi.EjbossClientContextFactory"); Context ctx = new InitialContext(p); JdbcEJBHome home = (JdbcEJBHome) ctx.lookup("Jdbc EJB"); JdbcEJB jdbc = home.create(); rs = jdbc.rset(); System.out.println("Your Query found... \n\n"); int vsize = rs.size(); int vstart = 0; while (vstart < vsize) { System.out.println(rs.elementAt(vstart)); vstart++; } // end of while statement System.out.println("Your query found "+vstart+" results."); } catch (Exception e) { System.out.println("Houston we have a problem "+e+" "+e.getMessage()); e.printStackTrace(); } } // end of method } // end of JdbcEJBClient Class