Could not load driver OracleDriver. Could not get JDBC Connection nested exception is SQLException: No suitable driver

I was working on Spring web services with Axis and I received this strange error related to my c3p0 connections:

java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver [[oracle.jdbc.driver.OracleDriver]]

Could not get JDBC Connection nested exception is SQLException: No suitable driver

It seems this is because my bean was containing some white spaces since I had copied the settings from other project. Here is the correct configuration for c3p0 with Oracle 9i

 <bean id="dataSourceC3PO" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">

oracle.jdbc.OracleDriver


jdbc:oracle:thin:@SERVER:1521:07


USERNAME


PASSWORD


3


3


1


15


100


oracle_server


20


select * from oracle_server

Do not forget to include Oracle driver ojdbc14.jar and c3po jar c3p0-0.9.1.2.jar in the class path.

Also, for those who need DBCP settings here they are:-

 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">







Advertisements

One thought on “Could not load driver OracleDriver. Could not get JDBC Connection nested exception is SQLException: No suitable driver

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s