Oracle Installation product folder and diag folder

2019-08-13 04:42发布

问题:

I'm confused because java is not working with Oracle. I'm trying to connect java to Oracle but I'm getting oracle.jdbc.driver.OracleDriver exception. I follow the all steps. Placed the ojdbc.jar file in jre/lib/ext director but still getting same exception. Recently It was working fine. But recently I installed windows and Oracle again. But during installation of Oracle by mistake I change the path in installation and now my Oracle directories are in this order.

admin
audit
cfgtoollogs
checkpoints
diag
OracleHome
--oradata
--product

But before new installation when connection working fine the Directory order was in this order.

OracleHome
--admin
--audit
--cfgtoollogs
--checkpoints
--diag
--oradata
--product

I'm confused may be exception could be caused due to this directories hirarchy? if yes then how I can solve it?

回答1:

The installation path is not important for the database connection from Java, the only important things are hostname/ip address of the server, server port, username, password and database alias. You have to check that all these informations are not changed with the new installation. Try to connect to your oracle database with a database client, if the connection works correctly then try to connect from your Java application. Here you can read a simple example:

http://www.mkyong.com/jdbc/connect-to-oracle-db-via-jdbc-driver-java/

I hope it can be useful for you.



标签: java oracle jdbc