mappingResources映射
mappingResources用于指定少量的hibernate配置文件 Xml代码
- <property name="mappingResources">
- <list>
- <value>WEB-INF/conf/hibernate/cat.hbm.</value>
- <value>WEB-INF/conf/hibernate/dog.hbm.</value>
- ......
- </list>
- </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代码
- <property name="mappingDirectoryLocations">
- <list>
- <value>WEB-INF/conf/hibernate</value>
- </list>
- </property>
<property name="mappingDirectoryLocations">
<list>
<value>WEB-INF/conf/hibernate</value>
</list>
</property>
annotatedClasses:可以接收我们注解的类
- <property name="annotatedClasses">
- <list><value>com.systop.common.core.dao.testmodel.TestDept</value></list>
- </property>
<property name="annotatedClasses"> <list><value>com.systop.common.core.dao.testmodel.TestDept</value></list> </property>
当有多个的时候,可以用扫描包的方法
- <property name="packagesToScan">
- <list><value>com.systop.common.core.dao.testmodel</value></list>
- </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;(解锁)
浙公网安备 33010602011771号