daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top