You could use google-apps-script or the google-spreadsheet-api 3.0 (GData). But I suspect the google-spreadsheet-api is what you want. Google-apps-script is like VBA and runs on google servers.
For GData, the CellDemo.java gives a good overview of the features. https://gdata-java-client.googlecode.com/svn-history/r51/trunk/java/sample/spreadsheet/cell/CellDemo.java
Note: there is no INSERT row, only APPEND row. with GData - google-spreadsheet-api 3.0
I have never used a public sheet, not sure. For a private sheet, you need OAuth2 or an Application password.