SSH

zyx0906840143 发布于 2017/03/12 19:27
阅读 98
收藏 0

错误信息:

三月 12, 2017 7:19:03 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 1017, SQLState: 72000
三月 12, 2017 7:19:03 下午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: ORA-01017: invalid username/password; logon denied

配置信息:

 

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="url" value="jdbc:oracle:thin:localhost:1521:orcl"/>
    <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
    <property name="password" value="scott"/>
    <property name="username" value="tiger"/>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
            <prop key="hibernate.show_sql">true</prop>
            <prop key="hibernate.format_sql">true</prop>
            <prop key="hibernate.jdbc.use_scrollable_resultset">false</prop>
        </props>
    </property>
    <property name="mappingDirectoryLocations">
        <list>
            <value>classpath:/entity/*.hbm.xml</value>
        </list>
    </property>
加载中
0
z
zyx0906840143

还有就是我分别用sqlplus和plsql登录都是没有问题的

0
z
zyx0906840143

我发现原因了,下面是正确的配置:

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="url" value="jdbc:oracle:thin:@localhost:1521:ORCL"/>
    <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
    <property name="username" value="scott"/>
    <property name="password" value="tiger"/>
</bean>
返回顶部
顶部