In the SPRINGMVC framework, Oracle Data sources are configured in Spring-servlet.xml as follows:
<bean id= "DataSource" class= "Org.apache.commons.dbcp.BasicDataSource"
destroy-method= "Close" >
<property name= "Driverclassname" >
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name= "url" >
<value>oracle:thin:@127.0.0.1:1521:orcl</value>
</property>
<property name= "username" >
<value>scott</value>
</property>
<property name= "Password" >
<value>XXXXX</value>
</property>
</bean>
The exception is as follows:
caused by:org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection; Nested exception is org.apache.commons.dbcp.SQLNestedException:Cannot create JDBC driver of class ' Oracle.jdbc.driver.OracleDriver ' for connect URL ' ORACLE:THIN:@127.0.0.1:1521:ORCL '
At Org.springframework.jdbc.datasource.DataSourceUtils.getConnection (datasourceutils.java:80)
At Org.springframework.jdbc.core.JdbcTemplate.execute (jdbctemplate.java:573)
At Org.springframework.jdbc.core.JdbcTemplate.query (jdbctemplate.java:637)
At Org.springframework.jdbc.core.JdbcTemplate.query (jdbctemplate.java:666)
At Org.springframework.jdbc.core.JdbcTemplate.query (jdbctemplate.java:674)
At Org.springframework.jdbc.core.JdbcTemplate.queryForObject (jdbctemplate.java:734)
At COM.SPRINGDEMO.MODULE.USERMGR.DAO.USERMGRDAO.GETUSERBYCOLUNM (usermgrdao.java:24)
At Com.springdemo.module.usermgr.service.UserMgrService.getUserByUserName (usermgrservice.java:44)
... More
Error reason: URL is not configured correctly and should be JDBC:ORACLE:THIN:@127.0.0.1:1521:ORCL