Changes between Version 9 and Version 10 of UTGBCore/SQLite


Ignore:
Timestamp:
10/12/07 21:27:28 (18 years ago)
Author:
leo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UTGBCore/SQLite

    v9 v10  
    1111The source code of this servlet is here:
    1212source:trunk/utgb/utgb-core/src/main/java/org/utgenome/gwt/utgb/server/app/SQLiteAccessSample.java
     13{{{
     14public class SQLiteAccessSample implements RequestHandler
     15{
     16    private static Logger _logger = Logger.getLogger(SQLiteAccessSample.class);
     17       
     18    public void handle(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
     19    {
     20        ArrayList<String> speciesList = new ArrayList<String>();
     21        try
     22        {
     23            // this will load database file from utgb-core/resource folder
     24            SQLiteAccess sqlite = UTGB.getSQLiteAccess("legacy-track.db");
     25            List<String> queryResult = sqlite.query("select distinct species from tracks order by species", "species", String.class);
     26            _logger.debug("species: " + queryResult);
     27            speciesList.addAll(queryResult);
     28           
     29            response.getWriter().println(StringUtil.join(queryResult, ", "));
     30        }
     31        catch (DBException e)
     32        {
     33            _logger.error(e);
     34        }
    1335
     36    }
     37
     38}
     39
     40}}}
    1441
    1542== Simple SQL query processing with BeanUtil ==