src/com/wherehoo/WHSearchOperation.java
/**
     * Searches the database for entries that are within set search area, in the set time interval, 
     * and satisfying other optional criteria, such as mimetype, protocol or metadata. <tt>executeAndOutputToClient</tt> 
     * then sends the results to the client via <tt>client_socket</tt>.
     * @param client_socket a socket of the connecting client.  After executing a search operation, this method sends
     * the results to the client via <tt>client_socket</tt>
     */
Searches the database for entries that are within set search area, in the set time interval,
and satisfying other optional criteria, such as mimetype, protocol or metadata. executeAndOutputToClient
then sends the results to the client via client_socket.
@param client_socket a socket of the connecting client.  After executing a search operation, this method sends
the results to the client via client_socket
Searches the database for entries that are within set search area in the set time interval and satisfying other optional criteria such as mimetype protocol or metadata . executeAndOutputToClient then sends the results to the client via client_socket . @param client_socket a socket of the connecting client . After executing a search operation this method sends the results to the client via client_socket
public synchronized void executeAndOutputToClient(Socket client_socket) throws IOException {
	ResultSet rs=null;
	Connection C;
	Statement s;
	String queryString;
	if (this.getVerbose()||this.getVeryVerbose()) System.out.println("Executing and outputing to client");
	try{
	    if (this.getVeryVerbose()) System.out.println("Connecting to database");
	    C = DriverManager.getConnection("jdbc:"+WHServer.DB,"postgres","");
	    C.setAutoCommit(false);
	    queryString=this.getQueryString();
	    s = C.createStatement();
	    if (this.getVeryVerbose()) System.out.println("About to execute query");
	    rs = s.executeQuery(queryString);
	    if (this.getVeryVerbose()) System.out.println("Commiting the query");
	    C.commit();
	    if (this.getVeryVerbose()) System.out.println("About to output to client");
	    this.outputToClient(rs,client_socket);
	    C.close();
	}
	catch (SQLException sqle) {
	    System.out.println("SQLException: " + sqle.getMessage());
	    System.out.println("SQLState:     " + sqle.getSQLState());
	    System.out.println("VendorError:  " + sqle.getErrorCode());
	} 
    }
public synchronized void executeAndOutputToClient ( Socket client_socket ) throws IOException { ResultSet rs = null ; Connection C ; Statement s ; String queryString ; if ( this . getVerbose ( ) || this . getVeryVerbose ( ) ) System . out . println ( "Executing and outputing to client" ) ; try { if ( this . getVeryVerbose ( ) ) System . out . println ( "Connecting to database" ) ; C = DriverManager . getConnection ( "jdbc:" + WHServer . DB , "postgres" , "" ) ; C . setAutoCommit ( false ) ; queryString = this . getQueryString ( ) ; s = C . createStatement ( ) ; if ( this . getVeryVerbose ( ) ) System . out . println ( "About to execute query" ) ; rs = s . executeQuery ( queryString ) ; if ( this . getVeryVerbose ( ) ) System . out . println ( "Commiting the query" ) ; C . commit ( ) ; if ( this . getVeryVerbose ( ) ) System . out . println ( "About to output to client" ) ; this . outputToClient ( rs , client_socket ) ; C . close ( ) ; } catch ( SQLException sqle ) { System . out . println ( "SQLException: " + sqle . getMessage ( ) ) ; System . out . println ( "SQLState:     " + sqle . getSQLState ( ) ) ; System . out . println ( "VendorError:  " + sqle . getErrorCode ( ) ) ; } }
Searches the database for entries that are within set search area, in the set time interval,
 and satisfying other optional criteria, such as mimetype, protocol or metadata.
Searches the database for entries that are within set search area in the set time interval and satisfying other optional criteria such as mimetype protocol or metadata .