下面是Azure关于Java的基本教程:https://www.windowsazure.com/en-us/develop/java/how-to-guides/table-service/#CreateTable
但遇到以下错误:
找不到符号 符号:方法createTableIfNotExists(java.lang.String) 位置: com.microsoft.windowsazure.services.table.client.CloudTableClient类
整个小程序(复制自Azure教程):
import com.microsoft.windowsazure.services.core.storage.*;
import com.microsoft.windowsazure.services.table.client.*;
import com.microsoft.windowsazure.services.table.client.TableQuery.*;
public class AzureTableWrite {
public static void main(String[] args) {
// Define the connection-string with your values
final String storageConnectionString =
"DefaultEndpointsProtocol=http;" +
"AccountName=skivvy;" +
"AccountKey=foobar";
// Retrieve storage account from connection-string
CloudStorageAccount storageAccount =
CloudStorageAccount.parse(storageConnectionString);
// Create the table client.
CloudTableClient tableClient = storageAccount.createCloudTableClient();
// Create the table if it doesn't exist.
String tableName = "people";
tableClient.createTableIfNotExists(tableName);
}
}有人遇到过同样的问题吗?任何帮助都是非常感谢的!
发布于 2012-10-01 16:13:40
正如我在MSDN论坛(http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/78c12f97-4209-41a1-86d6-267f5e9f51f6)上的响应中提到的,您使用的示例似乎存在问题。
请用这个代替:
CloudTableClient tableClient = storageAccount.createCloudTableClient();
CloudTable table = tableClient.getTableReference("people");
table.createIfNotExists();希望这能有所帮助。
https://stackoverflow.com/questions/12668170
复制相似问题