Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
- CloudTableClient tableClient = storageAccount.createCloudTableClient();
- CloudTable table = tableClient.getTableReference("people");
- table.createIfNotExist();
Add Comment
Please, Sign In to add comment