Now I need class oracle.jdbc.OracleConnection to use CLOB.createTemporary() but...I can't.
Why not? You have to explain, in detail, WHAT you are trying and WHY you say you "can't" do it.
According to the docs, it's enough to replace in code and config files one class declaration on another.
That is correct - this IS all that is required. Replace ALL references to 'oracle.jdbc.driver' in your code.
But NO. I replaced all of them in all config files and anyway, there was only oracle.jdbc.driver.OracleConnection has been created. (there is no explicit declaration of connection type in code, everything is configured in config files)
We can't SEE what 'config' information you say you changed. It is what is in the CODE that matters, not what is in a config file.
If the 'oracle.jdbc.driver' package is being imported by your code and a reference to 'Connection' is made Java will use it from the first package that it finds the class in.
You are using an ANCIENT jdbc jar file. That doc you linked to WARNS you that you should upgrade and that doc is over ten years old.
Remove that old jdbc jar file and use the current driver. Also remove references to the old package and replace them with references to the new package.
With code and jars that are that old you can expect to have problems trying to use additional features, especially extensions. I would be surprised if you didn't have other issues as well.
You need to perform code review to find all of the references that need to be corrected.
I solved the issue!
This thread helped me: https://forums.oracle.com/thread/556426 ("I have to use classes12.zip for it to work.")
The main problem was jdbc driver - I tried all ones that I found on oracle download page and the only driver that made the job was classes12.jar (Oracle Database 10g Release 2 (10.2.0.1.0)). I replaced it in "ORACLE_HOME\jdbc\lib\" and in "apache-tomcat\lib\"
Every driver has its own bugs and i did also different things so i can't say that just driver replacement is enough. F.e. I changed database timezone, run tzupdater, set vm param -Duser.timezone="-07:00", may be something else.
Thanks a lot for so detailed answer!