Hey guys,

I've got a pretty heavy gears app the works great in IE, Firefox and
Chrome; however, I'm getting some inconsistencies when running it on
Android using Gears GWT API 1.2.0. Whenever I seem to run ANY query, I
get a "Wrong number of SQL parameters" DatabaseException. Everything
works perfectly in the other browsers.

I'm debugging back to the client and my info is:
Exception Message: Wrong number of SQL parameters.
Method: selectUserByUserId
Parameters: [ 1 ]

Here is the method:

private static final String SELECT_USER = "SELECT user_id, sessionId,
name, email FROM user WHERE user_id = ?";

public User selectUserByUserId( long userId )
{
        final String[] params = new String[] { Long.toString
( userId ) };
        try
        {
                ResultSet rs = db.execute( SELECT_USER, params );
                for ( int i = 0; rs.isValidRow(); ++i, rs.next() )
                {
                        User user = new User();
                                user.setId( rs.getFieldAsLong( 0 ) );
                        user.setCurrentSessionId( rs.getFieldAsString
( 1 ) );
                        user.setName( rs.getFieldAsString( 2 ) );
                        return user;
                }
                rs.close();
        }
        catch ( DatabaseException e )
        {
                debugDBException( "selectUserByUserId", params, e );
        }
                return null;

}

The debugDBException method just rolls everything up an submits it to
the server.

Has anone else had this sort of issue working with Gears on Android?
I've tried the test 1.2 Gears LocalDB Test and it seems to fine. It
looks like I'm trying to do a VERY similar thing and I'm really
perplexed as to why it won't work.

Oh also, I should add, that I checked out the DB structure using the
little DB explorer guy that is available in the vanilla gears distro.

The SQLite DB looks identical as the one on the other platforms, just
without data ('cause of all the SQL errors, I assume)

Thanks!

Evan

PS. Sorry about the cross post. I'm just never sure where to put these
Gears/GWT questions!

Reply via email to