class GeoPackage {

    static TileEntry createTileEntry(ResultSet rs, Connection cx) throws SQLException, IOException {
        TileEntry e = new TileEntry();
        initEntry(e, rs);

        //load all the tile matrix entries
        PreparedStatement psm = cx.prepareStatement(format(
            "SELECT * FROM %s" + 
            " WHERE table_name = ?" +
            " ORDER BY zoom_level ASC", TILE_MATRIX_METADATA));
        try {
            psm.setString(1, e.getTableName());

            ResultSet rsm = psm.executeQuery();
            try {
                while(rsm.next()) {
                    TileMatrix m = new TileMatrix();
                    m.setZoomLevel(rsm.getInt("zoom_level"));
                    m.setMatrixWidth(rsm.getInt("matrix_width"));
                    m.setMatrixHeight(rsm.getInt("matrix_height"));
                    m.setTileWidth(rsm.getInt("tile_width"));
                    m.setTileHeight(rsm.getInt("tile_height"));
                    m.setXPixelSize(rsm.getDouble("pixel_x_size"));
                    m.setYPixelSize(rsm.getDouble("pixel_y_size"));

                    e.getTileMatricies().add(m);
                }
            }
            finally {
                close(rsm);
            }
        }
        finally {
            close(psm);
        }
        return e;
    }

    public  GeoPackage();
    public  GeoPackage(File file);
    public  GeoPackage(File file, String user, String passwd);
      GeoPackage(DataSource dataSource);
      GeoPackage(JDBCDataStore dataStore);

}