applicationContext.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd"
xmlns:tx="http://www.springframework.org/schema/tx">
<aop:config></aop:config>
<!-- 打开自动装配 -->
<context:annotation-config></context:annotation-config> <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.mysql.jdbc.Driver">
</property>
<property name="url"
value="jdbc:mysql://localhost:3306/mas?characterEncoding=UTF-8">
</property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>

hibernate.cfg.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory>
<mapping resource="cn/edu/nwsuaf/bean/Mas.hbm.xml" />
<mapping resource="cn/edu/nwsuaf/bean/Course.hbm.xml" />
<mapping resource="cn/edu/nwsuaf/bean/Teachingplanchange.hbm.xml" />
<mapping resource="cn/edu/nwsuaf/bean/Highleveltalent.hbm.xml" />
<mapping resource="cn/edu/nwsuaf/bean/Academicdegree.hbm.xml" />
<mapping

数据源只能在一个配置文件中配置:applicationContext.xml或者hibernate.cfg.xml。

SSH:dataSource配置问题的更多相关文章

  1. SSH免密登录的错误

    为了避免每次在测试环境启动hadoop都需要输入密码, 使用免密操作 ssh-keygen,然后一直按enter键 接着需要输入root密码, 输入root密码后一直报错,密码不正确, permiss ...

  2. 欧拉系统-登陆 SSH 出现 Access Denied 错误

    1./home 权限问题如果 /home 只支持 root 访问,那么不妨试一下 /tmp ,然后用 mv 命令再转移 2./etc/ssh/sshd_config 配置问题     vi  /etc ...

  3. Linxu SSH登陆出现Access Denied错误的解决方法

    其实这个问题是从 SCP 过来的.用 SCP 在两台 Linux 服务器之间传送备份文件.输入完 root 密码后,总是出现 Permission denied, please try again.  ...

  4. Nagios学习实践系列——配置研究[监控当前服务器]

    其实上篇Nagios学习实践系列——基本安装篇只是安装了Nagios基本组件,虽然能够打开主页,但是如果不配置相关配置文件文件,那么左边菜单很多页面都打不开,相当于只是一个空壳子.接下来,我们来学习研 ...

  5. vmware在桥接模式下配置centos7网络,并使用xshell连接虚拟主机(总结篇)

    虚拟机系统:centos7 mini版本 1.虚拟安装成功之后,首先我配置的是桥接模式,因为我使用的是网线,配置完桥接模式之后我的linux虚拟机就可以访问网络了 2.因为我安装的是centos7的迷 ...

  6. mac机器下远程仓库添加完毕之后,却无法上传应有的内容。

    Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you ha ...

  7. Nagios学习实践系列

    其实上篇Nagios学习实践系列--基本安装篇只是安装了Nagios基本组件,虽然能够打开主页,但是如果不配置相关配置文件文件,那么左边菜单很多页面都打不开,相当于只是一个空壳子.接下来,我们来学习研 ...

  8. SQL语句在数据库中可以执行在mybatis执行不了

    这个问题竟然纠结了半个小时! 就问题而言,肯定是出在mybatis中 终于,找到了答案, 原来是DataSource配置问题, 我将配置连接池的数据写到了文件db.properties中, SqlMa ...

  9. gogs仓库管理软件 exec: "git-upload-pack": executable file not found in $PATH

    当配置完个人中心的ssh公钥的时候,在客户端拉取代码的时候,提示如下错误: Cloning into 'comix-b2m'... Gogs: Internal error fatal: Could ...

随机推荐

  1. eclipse连接hadoop问题

    1,首先可以测试:hafs dfsadmin -safemode leave2,如果出现下面的问题Error:Permission denied: user= ,access=READ_EXECUTE ...

  2. Spring源码情操陶冶-AbstractApplicationContext#registerListeners

    承接前文Spring源码情操陶冶-AbstractApplicationContext#onRefresh 约定web.xml配置的contextClass为默认值XmlWebApplicationC ...

  3. 根据百度,gps坐标获取天气

    楼主用的是阿里天气免费版,限制1000次,可以重复购买 下面放代码 var orgWindow = new OrganizeWindowProxy(WorkContext); var orgInfo ...

  4. (5)UIView常见属性

    此时打印的所有子控件会把使用自动布局的控件也打印出来,不准确,所以得去掉这两个选项,再进行打印 使用实例如下: viewWithTag的注意点,当有多个相同的Tag值时,它是先找到第一个Tag值,而不 ...

  5. nopcommerce的WidgetZones

    来自:http://www.kingreatwill.com Hi, Having just started developing nopCommerce (and having forked out ...

  6. (转载)Stackoverflow评选的C++推荐书单

    C++必读书籍推荐 (原链接:http://bestcbooks.com/recommended-cpp-books 2013-10-07) 本文内容来自国外著名编程问答网站Stackoverflow ...

  7. com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null

    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be n ...

  8. NYOJ 289 苹果(01背包)

    苹果 时间限制:3000 ms  |  内存限制:65535 KB 难度:3   描述 ctest有n个苹果,要将它放入容量为v的背包.给出第i个苹果的大小和价钱,求出能放入背包的苹果的总价钱最大值. ...

  9. 66. Plus One【leetcode】

    Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. Yo ...

  10. react入门之使用react-bootstrap当轮子造车(二)

    react入门之使用react-bootstrap当轮子造车(二) 上一篇我们谈了谈如何配置react的webpack环境 react入门之搭配环境(一) 可能很多人已经打开过官方文档学习了react ...