2 qq 21463085 qq_21463085 于 2016.02.16 20:56 提问

关于myeclipse连接Oracle数据库问题

图片说明

详情:
2016-2-16 20:23:57 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [SpringMVC] in context with path [/BiYe] threw exception [Request processing failed; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
)] with root cause
java.sql.SQLException: ORA-01017: invalid username/password; logon denied

【补充:使用PL/SQL用户名/密码可以连上。】

7个回答

fk002008
fk002008   2016.02.16 22:00

invalid username/password

用户名和密码不对,你把配置数据库的xml贴出来看看

wen_wxpk
wen_wxpk 楼上正解,看看配置信息有没有问题
接近 2 年之前 回复
sinat_21950647
sinat_21950647   2016.02.17 09:42

xml里配置的用户名密码不匹配

sinat_21950647
sinat_21950647   2016.02.17 09:41

xml里配置的用户名密码不匹配

sinat_21950647
sinat_21950647   2016.02.17 09:41

xml里配置的用户名密码不匹配

beyon2008
beyon2008   2016.02.17 10:56

用户名密码配置不对,检查下

GPRSSSS
GPRSSSS   2016.02.25 15:51

我也遇到这个问题了,spring mvc 4.2, tomcat8, 用dbcp2连接的,用配置中的用户名、密码在sqlplus可以登陆上

GPRSSSS
GPRSSSS   2016.02.25 15:57

<?xml version="1.0" encoding="UTF-8"?>

xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.2.xsd">

<!-- 引入jdbc配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties" />

<!-- 创建jdbc数据源 -->
<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource"  
    destroy-method="close">  
    <property name="driverClassName" value="${driver}" />  
    <property name="url" value="${url}" />  
    <property name="username" value="${username}" />  
    <property name="password" value="${password}" />  
</bean>

<!-- (事务管理)transaction manager, use JtaTransactionManager for global tx -->  
<bean id="transactionManager"  
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">  
    <property name="dataSource" ref="dataSource" />  
</bean>  

<!-- 创建SqlSessionFactory,同时指定数据源 -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource" />
</bean>

<!-- 可通过注解控制事务 -->
<tx:annotation-driven />

<!-- 扫描 com.sunyd.spring.mapper下的所有配置文件-->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="com.sunyd.spring.mapper" /> 
</bean>


Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!