/** Inserts a row in the newly created table for the authenticated user. */ private static void insertData(String tableId) throws IOException { Sql sql = fusiontables .query() .sql( "INSERT INTO " + tableId + " (Text,Number,Location,Date) " + "VALUES (" + "'Google Inc', " + "1, " + "'1600 Amphitheatre Parkway Mountain View, " + "CA 94043, USA','" + new DateTime(new Date()) + "')"); try { sql.execute(); } catch (IllegalArgumentException e) { // For google-api-services-fusiontables-v1-rev1-1.7.2-beta this exception will always // been thrown. // Please see issue 545: JSON response could not be deserialized to Sqlresponse.class // http://code.google.com/p/google-api-java-client/issues/detail?id=545 } }
/** * @param tableId * @throws IOException */ private static void showRows(String tableId) throws IOException { View.header("Showing Rows From Table"); Sql sql = fusiontables.query().sql("SELECT Text,Number,Location,Date FROM " + tableId); try { sql.execute(); } catch (IllegalArgumentException e) { // For google-api-services-fusiontables-v1-rev1-1.7.2-beta this exception will always // been thrown. // Please see issue 545: JSON response could not be deserialized to Sqlresponse.class // http://code.google.com/p/google-api-java-client/issues/detail?id=545 } }