/* -- ' Copyright by Erica Andrews aka CyLiKoN JeZuZ aka Li'L CJ, ' January 2000. No one is permitted to implement this JavaBean ' or any portion of it on their site without the express written consent ' of the author (cylikon@hotmail.com - ./IcedPinky/). ' All rights reserved. ' This Bean was hand-coded in Java by Erica Andrews on Jan. 10, 2000 ' The bean works as a stored procedure for accessing related sites from my database by creating a setter method, which is set remotely using the setProperty in a JSP page. The parameter "showsite" sets the integer in the "WHERE itsgroup=" clause, which determines the category of sites to retrieve from the database. The getGenericShow() method then returns the RAW, unformatted ResultSet of the query, which can then be formatted into links, tables, forms, etc by the same JSP page. The Bean uses the ' gweMySQLJDBC 0.9.2 driver and MySQL 3.22.9 for database connectivity. -- */ package yahoo; import java.io.*; import java.beans.*; import java.util.*; import java.sql.*; import gwe.sql.*; public class ShowRelated { private String showsite; public ShowRelated() { showsite = null; } public void setShowsite( String name ) { showsite = name; } public String getShowsite() { return showsite; } public ResultSet getGenericShow() throws SQLException, ClassNotFoundException { Class.forName ("gwe.sql.gweMysqlDriver"); Connection conn = DriverManager.getConnection ("jdbc:mysql://:3306/siteindex2","MySecret","MySecret"); Statement stmt = conn.createStatement (); ResultSet rset = stmt.executeQuery ("SELECT id,itsgroup,url,title,thedate FROM thesites WHERE itsgroup='"+(getShowsite())+"'"); return (rset); } // --- ending method GenericShow } // - End of Class YahooBean