Jdbc query error (postgresql)

I connected to the db through jdbc
I am using this query :
select *, (end_time - start_time) as duration from system.connection_log order by start_time desc

it is parsing most of the field, but for duration field I am getting this error:

How can I write a proper query ? The same query is working directly in to the db.