Reputation: 73
I am new to spring and developing spring jdbc application. but driver class is not loaded. am getting exception that
org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
and my xml file is as follows:
<bean id="ds" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
<property name="username" value="system" />
property name="password" value="surekha" />
</bean>
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="ds"></property>
</bean>
<bean id="edao" class="EmployeeDao">
<property name="jdbcTemplate" ref="jdbcTemplate"></property>
</bean>
</beans>
anyone help me to this problem. thanks in advance.
Upvotes: 0
Views: 36048
Reputation: 121
I had the Same problem even adding the maven dependency in my pom.xml
I downloaded manualy the .jar in https://mvnrepository.com/artifact/com.oracle/ojdbc6/12.1.0.1-atlassian-hosted
and it worked for my project.
Upvotes: 0
Reputation: 29
Add Following dependency in pom.xml
<dependency>
<groupId>com.oracle</groupId>
<artifactId>oracle</artifactId>
<version>10.2.0.2.0</version>
</dependency>
Upvotes: 1
Reputation: 487
In your pom.xml , add this dependency :
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
Upvotes: 6
Reputation: 1
Add this jdbc-oracle.jar file into your project...
jdbc-oracle.jar is available in http://www.java2s.com/Code/Jar/j/Downloadjdbcoraclejar.htm
Upvotes: -1