Use correct way to detect content type
Always use explicit offset when working with JDBC