本文整理汇总了Java中com.google.api.services.fusiontables.Fusiontables.Query.Sql类的典型用法代码示例。如果您正苦于以下问题:Java Sql类的具体用法?Java Sql怎么用?Java Sql使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Sql类属于com.google.api.services.fusiontables.Fusiontables.Query包,在下文中一共展示了Sql类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showRows
import com.google.api.services.fusiontables.Fusiontables.Query.Sql; //导入依赖的package包/类
/**
* @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 {
Sqlresponse response = sql.execute();
System.out.println(response.toPrettyString());
} 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
}
}
示例2: insertData
import com.google.api.services.fusiontables.Fusiontables.Query.Sql; //导入依赖的package包/类
/** 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
}
}
示例3: executeSql
import com.google.api.services.fusiontables.Fusiontables.Query.Sql; //导入依赖的package包/类
@Override
public String executeSql(String query) throws IOException {
if (!fusiontables.isPresent())
return NOT_CONNECTED;
Sql sql = fusiontables.get().query().sql(query);
Sqlresponse response = null;
response = sql.execute();
getTableInfo();
return response.toPrettyString();
}
示例4: createNewPoint
import com.google.api.services.fusiontables.Fusiontables.Query.Sql; //导入依赖的package包/类
/**
* Creates a new row in Google Fusion Tables representing a marker as a point.
*
* @param fusiontables fusion tables
* @param tableId the table id
* @param name the marker name
* @param description the marker description
* @param location the marker location
* @param type the marker type
*/
private void createNewPoint(Fusiontables fusiontables, String tableId, String name,
String description, Location location, String type) throws IOException {
String values = SendFusionTablesUtils.formatSqlValues(
name, description, SendFusionTablesUtils.getKmlPoint(location), type);
Sql sql = fusiontables.query()
.sql("INSERT INTO " + tableId + " (name,description,geometry,icon) VALUES " + values);
sql.execute();
}