Things you can do to avoid high bills from Google Cloud

In this post I would like to focus on Cloud Billing and possible ways of avoiding unpleasant surprise at the end of the month related to bill from Google Cloud. If your free trial just ended, you want to start your adventure with GCP or simply try new things this might be the right place for you. For those who already have some services deployed and GCP and are looking for advices how to cut/optimize the costs I will write separate post.

How to check if value from ResultSet returned NULL?

Fetching data from NULLABLE columns via JDBC might be tricky since java.sql.ResultSet returns primitive values. If such column contains NULL user will get default value ex. 0 for int. Ignoring this behaviour may lead to serious bugs.