T4CConnection cannot be cast to a OracleConnection

Leave a comment

Very Simple

(1) Your WAR should not contain odbcX.jar file within classes or lib directory

(2) Add odbcX.jar file to tomcat’s common/lib

 

Cheers

 

Conversion between two timezone in Oracle

Leave a comment

Procedure demonstrate how to convert time between two timezone.


DECLARE
 v_operator varchar2(1) ;
 v_hours number(2);
 v_min number(2);
 v_total_min number(4);
 v_datetime varchar2(128);
 v_sessiondatetime varchar2(128);
 BEGIN

select substr(tz_offset( sessiontimezone ),0,1) INTO v_operator from dual;

select to_number(substr(tz_offset( sessiontimezone ),2,2)) INTO v_hours from dual;

select to_number(substr(tz_offset( sessiontimezone ),5,2)) INTO v_min from dual;

v_total_min := v_hours * 60 + v_min;

if v_operator = '+' then
 select to_char(sysdate - (.000694 *v_total_min ) , 'HH24:MI') into v_datetime from dual;
 else
 select to_char(sysdate +  (.000694 *v_total_min ), 'HH24:MI') into v_datetime from dual;
 end if;
 select to_char(sysdate, 'HH24:MI') into v_sessiondatetime from dual;

dbms_output.put_line(v_sessiondatetime );
 dbms_output.put_line(v_datetime);

END;

This is very simple example, you can use this as a reference to complete your needs.

Cheers

Follow

Get every new post delivered to your Inbox.