hi Eric,
thanks for your help.

the error message is :
HTTP ERROR: 404

NOT_FOUND

RequestURI=/Gwtgears.html

and this is the code for a test app using gwt 1.6 + gears 1.2 (under
firefox):

package com.zbr.gwtgears.client;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyUpEvent;
import com.google.gwt.event.dom.client.KeyUpHandler;
import com.google.gwt.gears.client.Factory;
import com.google.gwt.gears.client.GearsException;
import com.google.gwt.gears.client.database.Database;
import com.google.gwt.gears.client.database.DatabaseException;
import com.google.gwt.gears.client.database.ResultSet;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Gwtgears implements EntryPoint {
        /**
         * The message displayed to the user when the server cannot be
reached or
         * returns an error.
         */
        private Database db;
        public void onModuleLoad() {

            // Create the database if it doesn't exist.
            try {
              db = Factory.getInstance().createDatabase();
              db.open("gears-database-tutorial");
              // The 'int' type will store up to 8 byte ints depending on the
magnitude of the
              // value added.
              db.execute("create table if not exists tutorial (Timestamp
int)");
            } catch (GearsException e) {
              Window.alert(e.toString());
            }

            // Add an entry to the database
            try {
              db.execute("insert into tutorial values (?)", new String[] {
                  Long.toString(System.currentTimeMillis())});
            }
            catch (DatabaseException e) {
              Window.alert(e.toString());
            }

            // Fetch previous results from the database.
            List<String> timestamps= new ArrayList<String>();
            try {
              ResultSet rs = db.execute("select * from tutorial order by
Timestamp");
              for (int i = 0; rs.isValidRow(); ++i, rs.next()) {
                timestamps.add(rs.getFieldAsString(0));
              }
              rs.close();
            } catch (DatabaseException e) {
              Window.alert(e.toString());
            }

            // Display the list of results in a table
            Grid grid = new Grid(timestamps.size() + 1, 1);
            grid.setText(0, 0, "Accesses to this Page:");
            for (int row = 0; row < timestamps.size(); ++row) {
              Date stamp = new Date(Long.valueOf(timestamps.get(row)));
              grid.setText(row + 1, 0, stamp.toString());
            }

            RootPanel.get().add(grid);
          }}

thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to