applicationContext.xml

  1.  
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
  5.  
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans
  7. http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
  8. http://www.springframework.org/schema/aop
  9. http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  12. http://www.springframework.org/schema/tx
  13. http://www.springframework.org/schema/tx/spring-tx.xsd"
  14. xmlns:tx="http://www.springframework.org/schema/tx">
  15. <aop:config></aop:config>
  16. <!-- 打开自动装配 -->
  17. <context:annotation-config></context:annotation-config>
  18.  
  19. <bean id="dataSource"
  20. class="org.apache.commons.dbcp.BasicDataSource">
  21. <property name="driverClassName"
  22. value="com.mysql.jdbc.Driver">
  23. </property>
  24. <property name="url"
  25. value="jdbc:mysql://localhost:3306/mas?characterEncoding=UTF-8">
  26. </property>
  27. <property name="username" value="root"></property>
  28. <property name="password" value="root"></property>
  29. </bean>

hibernate.cfg.xml

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  4. "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  5.  
  6. <hibernate-configuration>
  7.  
  8. <session-factory>
  9. <mapping resource="cn/edu/nwsuaf/bean/Mas.hbm.xml" />
  10. <mapping resource="cn/edu/nwsuaf/bean/Course.hbm.xml" />
  11. <mapping resource="cn/edu/nwsuaf/bean/Teachingplanchange.hbm.xml" />
  12. <mapping resource="cn/edu/nwsuaf/bean/Highleveltalent.hbm.xml" />
  13. <mapping resource="cn/edu/nwsuaf/bean/Academicdegree.hbm.xml" />
  14. <mapping
  1.  

数据源只能在一个配置文件中配置: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. jmeter问题处理随笔1 - 自动遍历用例(一次)

    背景: 弄了个无业务关联的巡检接口方案,需要循环获取csv中的数据,每一条数据,运行一次,直到全部运行完,但是使用后发现要通过[线程组]中设置循环变量的数据为来读取csv中的数据,这样每次修改csv用 ...

  2. tensorflow dropout函数应用

    1.dropout dropout 是指在深度学习网络的训练过程中,按照一定的概率将一部分神经网络单元暂时从网络中丢弃,相当于从原始的网络中找到一个更瘦的网络,这篇博客中讲的非常详细   2.tens ...

  3. (转)Java中equals和==的区别

    java中的数据类型,可分为两类:  1.基本数据类型,也称原始数据类型.byte,short,char,int,long,float,double,boolean    他们之间的比较,应用双等号( ...

  4. App 组件化/模块化之路——Repository 模式

    什么是 Repository 模式 Repository 这个词直译过来仓库.仓储的意思.这个意思其实也能反应出 Repository 模式作用.App 开发中少不了对数据的操作,数据的来源可能有很多 ...

  5. 【javascript】继承

    1. js 其实是一个非面向对象的语言,通过对象的深浅复制完成继承 2. 继承方法 继承的方法有两种 1)prototype 原型模式 举个例子 var Animal = function () { ...

  6. Linux学习笔记--一些错误的记录

    运行linux的时候,输入shutdown -r now命令提示:bash:shutdown is not found.出现这个错误是因为这条命令没有加入到系统的配置文件中,运行命令export PA ...

  7. SQL Server ---T-SQl基本语句

    T-SQL 是 SQL-Server 的结构化查询语言. 基本数据操作语言. 基础语句 先创建表 我后面的列子都是用的这一个表,列名啥的 就大概看看吧~~ 纯粹为了学习语句,语法~~所以先创建个表吧~ ...

  8. Linux修改网卡名称、主机名

    Linux修改网卡名称.主机名 环境:VirtualBox 5.0.14 + RHEL 6.5 需求:个人实验搭建一套Standby RAC时,为了节约时间,直接复制之前安装RAC的主机模板. 但复制 ...

  9. Tornado session 插件 pycket 定制时间和时间续租

    功能描述:10分钟用户没有任何操作,跳转到登录页面. 分析:这个功能用session就能实现(由于pycket 的session内容是存储在memcached或者redis里面的.所以,session ...

  10. 模拟实现C库的atoi、atof和itoa

    1.C函数atoi atoi (表示 alphanumeric to integer)是把字符串转换成整型数的一个函数.广泛的应用在计算机程序和办公软件中.atoi( ) 函数会扫描参数 nptr字符 ...