import java.sql.*; import java.io.*; import com.sybase.jaguar.jcm.*; import com.sybase.jaguar.util.*; import com.sybase.jaguar.sql.*; import com.sybase.jaguar.server.*; public class Customer extends Object { public void retrieve() { ResultSet rs = null ; boolean rc = false ; try { // Call the Jaguar cache manager to get a cache entry JCMCache Cache = JCM.getCache( "dba", "sql", "jdbc:odbc:marketingdata"); // create a JDBC connection; if a connection isn't available Connection connection = Cache.getConnection(JCMCache.JCM_FORCE); Statement stmt = connection.createStatement(); stmt.execute( "SELECT company_name, id FROM customer ORDER BY company_name" ); rs = stmt.getResultSet(); // Send the result set to the Jaguar Server if ( rs != null ) JContext.forwardResultSet( rs ) ; // Release the database connection back to the pool Cache.releaseConnection(connection); } catch (JException je) { je.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } // END OF THE TRY } // end of retrieve method