0

Our Java program has been installed on the RHEL 8.5 OS platform. And for database operations in our application, we use hibernate (version hibernate-3.2.7.ga.jar). Additionally, we are utilizing the JDBC driver(version 19.15) and the Oracle 19c(version 19.15) database. But in the log file, we found the below details which were printed from the hibernate.jar file.

15:23:46,949 INFO [SettingsFactory] RDBMS: Oracle, version: Oracle Database 11g Release 11.1.0.0.0 - Production 15:23:46,949 INFO [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 10.2.0.3.0

The code part in SettingsFactory.class file from hibernate.jar is,

  ConnectionProvider connections = createConnectionProvider(props);
  Connection conn = connections.getConnection();
          try {
              DatabaseMetaData meta = conn.getMetaData();
              databaseName = meta.getDatabaseProductName();
              databaseMajorVersion = getDatabaseMajorVersion(meta);
              log.info("RDBMS: " + databaseName + ", version: " + meta.getDatabaseProductVersion() );
              log.info("JDBC driver: " + meta.getDriverName() + ", version: " + meta.getDriverVersion() );
              }

We are confident that nowhere uses 11g, both from the code and the DB side. However, it is yet unclear how Hibernate retrieves this information.

Additionally, I've developed a Java class for the application that uses DatabaseMetaData objects to check the database information. Here, I just received the 19c specifics of the projected results.

Product Name - Oracle
Product Version - Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.15.0.0.0
Driver Name - Oracle JDBC driver
Driver Version - 19.15.0.0.0
URL - jdbc:oracle:thin:@XX:XX:XX:XX:1521:XXXX
RDBMS: Oracle, version: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.15.0.0.0
JDBC driver: Oracle JDBC driver, version: 19.15.0.0.0

Please let us know the table from which hibernate retrieves the database details and how to overcome the above issue.

Thanks in advance.

Learner
  • 91
  • 2
  • 9
  • I would say you are looking at the wrong server. On your installed application there must be and older version of the driver in the classpath, and in your network there is an Oracle 11g server somewhere – areus Jan 04 '23 at 07:32
  • @areus.. If the application is looking at the wrong server, then whenever we try to get the DB details, we got the expected results. And there is no record for Oracle 11g details in Java Code as well as from the DB side. – Learner Jan 04 '23 at 15:14
  • Maybe hibernate uses some own driver. Do you use pom? You can see a dependency hierarchy in your eclipse or whatever – siggemannen Mar 11 '23 at 13:24

0 Answers0