Environment: WinXP, iReport1.2.8, Oracle 10g database
After installation completes iReport1.2.8, when making database connection, the Oracle 10g database is connected by JDBC, the connection is set up as follows: The above configuration is correct, but appears when the "Test" button is clicked:
ClassNotFoundError:oracle.jdbc.driver.oracleDriver Check your classpath! error code, as shown in the following illustration:
The reason is simple: primarily because ireport did not find the oracle10g JDBC driver, there was no Windows driver built into the oreacle10g in iReport1.2.8, only the built-in MySQL driver, So there is no such problem with connecting to the MySQL database.
Workaround:
1. Add the Oracle10 driver (Classes12.jar) to the ireport Classpath, select the Options menu in ireport, and click "Classpath" to add jar packs to the pop-up window ( Classes12.jar), you will be prompted for success when you re testing.
Note: This method simply tells ireport how to find the driver, does not copy the driver itself into the ireport, and if the driver position changes, ireport will not be able to find it, preferably the second way to ensure unnecessary trouble.
2. The drive (Classes12.jar) is copied directly to the Jaspersoft\ireport-1.2.8\lib in the IReport installation directory, and all packages used by IReport are stored in Lib.