Guest User

Untitled

a guest
Jan 17th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. import com.microsoft.windowsazure.services.core.storage.*;
  2. import com.microsoft.windowsazure.services.table.client.*;
  3. import com.microsoft.windowsazure.services.table.client.TableQuery.*;
  4.  
  5. public class AzureTableWrite {
  6. public static void main(String[] args) {
  7. // Define the connection-string with your values
  8. final String storageConnectionString =
  9. "DefaultEndpointsProtocol=http;" +
  10. "AccountName=skivvy;" +
  11. "AccountKey=foobar";
  12.  
  13. // Retrieve storage account from connection-string
  14. CloudStorageAccount storageAccount =
  15. CloudStorageAccount.parse(storageConnectionString);
  16.  
  17. // Create the table client.
  18. CloudTableClient tableClient = storageAccount.createCloudTableClient();
  19.  
  20. // Create the table if it doesn't exist.
  21. String tableName = "people";
  22. tableClient.createTableIfNotExists(tableName);
  23. }
  24. }
  25.  
  26. CloudTableClient tableClient = storageAccount.createCloudTableClient();
  27. CloudTable table = tableClient.getTableReference("people");
  28. table.createIfNotExist();
Add Comment
Please, Sign In to add comment