简体   繁体   中英

How to connect to the Azure database for MySQL and PostgreSQL in JAVA

发布了两个新的Azure服务, 用于MySQLPostgreSQL的 Azure数据库 ,作为一个Java开发人员,我想知道如何连接它们,常规JDBC驱动程序是否仍然有用?

MySQL and Postgres as-a-service are accessed with already-existing drivers/sdk's. Just get the connection string from the portal, and then connect.

You'll see all of your connection strings in the portal, after your database instance is created:

门户中的连接字符串

Yes, it works except that you have to append @ to the user name portion of the connection string.

jdbc:postgresql:// servername .postgres.database.azure.com:5432/{your_database}?user=@ servername &password={your_password}&ssl=true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM