You could try reassembling the string along these lines to have a zero in the right place- and use the DDMMYYYYHH24MISS
format
to_date(
case length(input)
when 14 THEN -- the length is OK: this has 2 digits at the hour
input
when 13 THEN -- length is one short, have to add one '0'
substr(input,0,8) || '0' || substr(input, 9)
END,
'DDMMYYYYHH24MISS')
Though I must say, this is ugly, and probably has "less than optimal" performance... I'd much rather change the Java side format, as this format is clearly not a standard one. Individualism can be good at times - this is clearly not the case. This will just cause pain in the long term...