简体   繁体   English

如果不存在,是否可以使用 Java 代码在 PostgreSQL 中为 Azure 动态创建数据库? 如果是,如何?

[英]Is it possible to create a database on fly in PostgreSQL for Azure using Java code if it does not exist? If yes, how?

I want to create database and tables on the fly in PostgreSQL in Azure cloud using Java code .我想使用 Java 代码在 Azure 云中的 PostgreSQL 中动态创建数据库和表。 How to create a database in PostgreSQL for Azure using Java code if it does not exist?如果不存在,如何使用Java代码在PostgreSQL为Azure创建数据库?

Connect to the server through an Admin User通过管理员用户连接到服务器

And run the following query:并运行以下查询:

CREATE DATABASE database_name OWNER your_owner;

For more information check this .有关更多信息,请查看

This is plain Java though, you have to check whether something like this is possible in Azure.虽然这是普通的 Java,但您必须检查在 Azure 中是否可能出现类似的情况。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Azure DevOps 为 PostgreSQL 自动部署 Azure 数据库 - How to Automate Deployment of Azure Database for PostgreSQL using Azure DevOps 将 csv 文件从 s3 导入 rds PostgreSQL 数据库 > 错误:模式“aws_commons 不存在 - Importing a csv file from s3 into rds PostgreSQL Database > Error: schema "aws_commons does not exist SAS - 使用与 Azure DB 的新 DSN 连接运行 PROC SQL 时出现“错误:文件 ____ 不存在” - SAS - "ERROR: File ____ Does Not Exist" when running PROC SQL using new DSN connection to Azure DB 如何使用 Airflow 将 CSV 文件从 Azure Data Lake/Blob 存储传输到 PostgreSQL 数据库 - How to transfer a CSV file from Azure Data Lake/Blob Storage to PostgreSQL database with Airflow 是否可以使用 PowerShell 脚本创建 Azure Databricks 集群? - Is it possible to create Azure Databricks Cluster using PowerShell script? 如何使用 java sdk 在 azure 数据湖 gen1 中创建资源? - How to create resources in azure data lake gen1 with java sdk? 使用 terraform 如何从备份创建 azure sql 数据库 - Using terraform how do I create an azure sql database from a backup 无法使用 Visual Studio 发布 Azure Function:禁用创建按钮 - Publishing Azure Function using Visual Studio not possible: Create button disabled “错误”类型上不存在属性“代码” - Property 'code' does not exist on type 'Error' 在 Azure Postgresql 数据库诊断设置中没有可见的事件中心命名空间 - No event hub namespace visible in Azure Postgresql Database Diagnostic setting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM