gwtとgoogle gears

いやー
最近、sqliteをやりたくて、google gearsはじめましたが、
さすがに、手書きJavascriptつらくて、gwtをはじめました。

ちょうどgwt用のgears apiが出てたので
http://code.google.com/p/gwt-google-apis/
試しましたが、エラーメッセージがobject Errorとしか出ず何か変でした。

SVNをろくに調べもせず、以下のようなdatabase2を作って回避しました。
変更したのは、e.toString()をe.message だけですがこれで、GWTで開発する気力がわきました。
そのうち、1.1でる見たいので、エラーログが取れるようになってるといいな
/*
* Copyright 2007 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.gears.database.client;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.gears.core.client.Gears;
import com.google.gwt.gears.core.client.GearsException;

/**
* An in-browser SQL database. Gears provides a SQL database using SQLite
* syntax. For details, see the SQLite
* syntax.

*
* Note that this class (and its related classes) intentionally do NOT implement
* the JDBC interface, since the database provided by Gears does necessarily
* implement all those semantics. It may be possible to add a JDBC layer on top
* of this, but it's unclear whether that would really be useful.
*/
public class Database2 extends Database{

/**
* Native proxy call to the execute method on the JavaScript object.
*
* @param statement the SQL statement to execute
* @param args arguments to expand, or null if there are none
* @return the JavaScript object corresponding to a ResultSet
*/
private static native JavaScriptObject nativeExecute(
JavaScriptObject database, String statement, String[] args)
throws DatabaseException /*-{
try {
if (args == null) {
return database.execute(statement);
} else {
var newArgs = @com.google.gwt.gears.core.client.impl.GearsImpl::convertToJavaScript([Ljava/lang/String;)(args);
return database.execute(statement, newArgs);
}
} catch (e) {
@com.google.gwt.gears.core.client.impl.GearsImpl::throwDatabaseException(Ljava/lang/String;)(e.message);
}
}-*/;

public Database2(String databaseName) throws GearsException {
super(databaseName, Gears.DATABASE, Gears.GEARS_VERSION);
}




/**
* Executes the indicated SQL statement, and returns the results. Note that
* the {@link ResultSet} returned must be closed when it is no longer needed.
*
* @param statement the SQL statement to run
* @return a new ResultSet containing the results; never null
* @throws DatabaseException if the statement failed to execute
* @throws NullPointerException if statement is
* null
*/

public ResultSet execute(String statement) throws DatabaseException {
if (statement == null) {
throw new NullPointerException();
}

return new ResultSet(nativeExecute(getJavaScriptObject(), statement, null));
}




}