當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。