mappingResources映射

mappingResources用于指定少量的hibernate配置文件 Xml代码 

  1. <property name="mappingResources">    
  2.       <list>    
  3.             <value>WEB-INF/conf/hibernate/cat.hbm.</value>    
  4.             <value>WEB-INF/conf/hibernate/dog.hbm.</value>    
  5.                 ......     
  6.       </list>    
  7. </property>   
<property name="mappingResources">  
      <list>  
            <value>WEB-INF/conf/hibernate/cat.hbm.</value>  
            <value>WEB-INF/conf/hibernate/dog.hbm.</value>  
                ......   
      </list>  
</property> 

  就这样一个一个的写呗,当你觉得麻烦的时候,找mappingDirectoryLocations来就行了 Xml代码 

  1. <property name="mappingDirectoryLocations">    
  2.        <list>    
  3.     <value>WEB-INF/conf/hibernate</value>    
  4.        </list>    
  5. </property>    
<property name="mappingDirectoryLocations">  
       <list>  
    <value>WEB-INF/conf/hibernate</value>  
       </list>  
</property>  

 

annotatedClasses:可以接收我们注解的类

  1. <property name="annotatedClasses">    
  2.    <list><value>com.systop.common.core.dao.testmodel.TestDept</value></list>    
  3. </property>    
<property name="annotatedClasses">  
   <list><value>com.systop.common.core.dao.testmodel.TestDept</value></list>  
</property>  

 

当有多个的时候,可以用扫描包的方法

 

  1. <property name="packagesToScan">  
  2.       <list><value>com.systop.common.core.dao.testmodel</value></list>  
  3. </property>  
<property name="packagesToScan">
      <list><value>com.systop.common.core.dao.testmodel</value></list>
</property>


Oracle 11g中修改被锁定的用户:scott

在安装完Oracle10g和创建完oracle数据库之后,想用数据库自带的用户scott登录,看看连接是否成功。

在cmd命令中,用“sqlplus  scott/ tiger”登录时,老是提示如下信息: ERROR:ORA-28000:账户已被锁定。

在cmd命令提示符中可直接登录oracle,输入如下命令:

sqlplus / as sysdba;

接着执行如下命令:

SQL> alter user scott account unlock;

显示用户已更改,这样就完成解锁的操作。

接下来,你还可以重新给scott这个用户设定密码

修改scott的登录密码:

SQL> alter user scott identified by grace;

显示用户已更改,(grace为新的密码)

这样就OK了,测试一下scott/grace能否成功登录

SQL> conn scott/grace

显示已连接。

初学Oracle 数据库的小总结:

在cmd命令中输入sqlplus可以连接数据库,其格式为:

sqlplus 用户名/密码  

如:sqlplus scott/tiger;

在SQL Plus 中输入conn可以连接数据库,其格式为:

SQL> conn 用户名/密码 

如:conn scott/tiger;

在SQL Plus修改普通用户密码,其格式为:

aler user 用户名 identified by 密码

如:alter user scott identified by grace;

Oracle中给用户加锁与解锁的代码:

SQL> alter user 用户名 account lock;(加锁)

SQL> alter user 用户名 account unlock;(解锁)

posted on 2015-12-09 22:25  eslung  阅读(39)  评论(0)    收藏  举报