you can use search bar or menu to find the SQL
5.1 you can search the API using Platform search bar Cloud SQL Admin API. you have enable this API service to access the DATABASE.
6. Last we need to create server account to access the services with secure and authenticate credentials by Creating Service Account for SQL admin access.
#Project name in Gcloud
spring.cloud.gcp.project-id=springcloud-data-sql
# SQL instance connection name
spring.cloud.gcp.sql.instance-connection-name=springcloud-data-sql:australia-southeast1:sada-postgresql-instance
#Databae name
spring.cloud.gcp.sql.database-name=postgres
spring.datasource.username=postgres
#password
spring.datasource.password=sada
#Json credentials to access the gloud account.
spring.cloud.gcp.credentials.location=file:/Users/X270/Desktop/springcloud-data-sql-95f7ceb8e5ec.json
spring.jpa.generate-ddl=true
once you configure the all the details in application.properties file.
mvn spring-boot:run
gcloud sql connect sada-postgresql-instance --user=postgres --quiet
\c postgres
\dt
select * from product;
@Test
public void testProduct(){
List<Product> a=productRepository.findAll();
for(Product product : a){
//System.out.println(product.getId());
System.out.println("Tesla Model: "+ product.getName());
System.out.println("Tesla Price: "+ product.getPrice());
System.out.println("Warehouse: "+ product.getWarehouse());
System.out.println("-------------------------------------");
}