JDBC Connection to Oracle DB

조회 수: 2 (최근 30일)
Pete sherer
Pete sherer 2019년 12월 6일
편집: Piyush Kumar 2024년 10월 30일
Hi I have insalled the new Java driver and got the following error
'JDBC Driver Error: No suitable driver found for jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=NA2Dcxcc)(PORT=1451)) (CONNECT_DATA=(SERVICE_NAME= X89FXZZ)))'
Could you help provide steps how to resolve this? Looks like I need to reinstall older Java SRE. However everytime, I restarted machine. I will get the same error message again

답변 (1개)

Piyush Kumar
Piyush Kumar 2024년 10월 30일
편집: Piyush Kumar 2024년 10월 30일
Hi,
The error you're encountering may be due to the JDBC driver not being included in the MATLAB search path.
To resolve this, you can add the downloaded jar file to the path using the javaaddpath function in MATLAB -
javaaddpath('C:\path\to\your\ojdbc8.jar');
To avoid adding the path manually every time you start MATLAB, create a "startup.m" file in your MATLAB user directory. By default, MATLAB adds the userpath folder to the search path at startup. Add the javaaddpath command to this file. MATLAB will execute this file automatically at startup.
% Content of startup.m
javaaddpath('C:\path\to\your\ojdbc8.jar');
Some extra points to take care of -
  • Ensure that the JDBC driver is installed correctly.
  • Ensure that the Java version you are using is compatible with the JDBC driver. Oracle JDBC drivers have specific Java version requirements.
  • Double-check the JDBC connection string for correctness.
  • Make sure there are no conflicting Java versions installed on your system. Sometimes, multiple Java installations can cause issues with JDBC driver recognition.
NOTE: I was facing a similar error message - "JDBC Driver Error: No suitable driver found for jdbc:mysql://localhost:3306/?characterEncoding=UTF-8&". Implementing the steps mentioned above resolved the issue for me.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by