import com.microsoft.windowsazure.services.core.storage.*; import com.microsoft.windowsazure.services.table.client.*; import com.microsoft.windowsazure.services.table.client.TableQuery.*;
public static final String storageConnectionString = "DefaultEndpointsProtocol=http;" + "AccountName=[yourAccount];" + "AccountKey=[yourKey]"; String storageConnectionString = RoleEnvironment.getConfigurationSettings().get("StorageConnectionString");
<%@ page import="com.microsoft.windowsazure.services.core.storage.*" %> <%@ page import="com.microsoft.windowsazure.services.table.client.*" %> <%@ page import="com.microsoft.windowsazure.services.table.client.TableQuery.*" %> <html> <head> <title>ThaiCreate.Com Azure Tutorial</title> </head> <body> <% String storageConnectionString = "DefaultEndpointsProtocol=http;" + "AccountName=[yourAccount];" + "AccountKey=[yourKey]"; // 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 = "customer"; tableClient.createTableIfNotExists(tableName); out.print("Storage Table 'customer' has been created."); %> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท