I have a sql query which I fire on sql plus and I get the result. The same query when I fire from java code - jdbc I get an exception -
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended.
The query is
select prod_id, prod_area, prod_name, step_name,
to_char(entry_time, 'DD/MM/YYYY HH24:MI:SS') as entry_time,
round(extract(day from current_timestamp - entry_time)*1440 +
extract(hour from current_timestamp - entry_time)*60 +
extract(minute from current_timestamp - entry_time)) as pending_minutes
from prodreport
where exit_time is null;
java code
String query = "select prod_id,prod_area,prod_name,step_name,to_char(entry_time, 'DD/MM/YYYY HH24:MI:SS') as entry_time, round(extract(day from current_timestamp - entry_time)*1440 + extract(hour from current_timestamp - entry_time)*60 + extract(minute from current_timestamp - entry_time)) as pending_minutes from prodreport where exit_time is null;"
;from the query string?