0
当我在本地连接到Google MySQL帐户时,它从云MySQL表中检索记录。但是当我在生产环境中部署我的应用程序时,记录不会到来,但是200 OK即将到来。与Google App Engine和Google Cloud上的连接产生的问题
我已经尝试过
String url = null;
try {
if (SystemProperty.environment.value() ==
SystemProperty.Environment.Value.Production) {
// Load the class that provides the new "jdbc:google:mysql://" prefix.
Class.forName("com.mysql.jdbc.GoogleDriver");
url = "jdbc:google:mysql://your-project-id:your-instance-name/guestbook?user=root";
} else {
// Local MySQL instance to use during development.
Class.forName("com.mysql.jdbc.Driver");
url = "jdbc:mysql://127.0.0.1:3306/guestbook?user=root";
// Alternatively, connect to a Google Cloud SQL instance using:
// jdbc:mysql://pi-address-of-google-cloud-sql-instance:3306/guestbook?user=root
}
} catch (Exception e) {
e.printStackTrace();
return;
}
我用java