当前位置: 首页>>代码示例>>Java>>正文


Java Sql类代码示例

本文整理汇总了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
  }
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:22,代码来源:FusionTablesSample.java

示例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
  }
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:16,代码来源:FusionTablesSample.java

示例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();
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:15,代码来源:FusionTablesConnector.java

示例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();
}
 
开发者ID:Plonk42,项目名称:mytracks,代码行数:19,代码来源:SendFusionTablesAsyncTask.java


注:本文中的com.google.api.services.fusiontables.Fusiontables.Query.Sql类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。