易截截图软件、单文件、免安装、纯绿色、仅160KB

关于hibernate配置c3p0连接池连接mysql问题

前些天看了李刚<struts2+hibernate+spring>那书上的hibernate,配置文件也是按照上面敲进hibernate.cfg.xml文件的,Student.java配置的Student.hbm.xml文件觉得也没什么问题,但不知到怎么回事就是报 connection can not open。郁闷啊,后来我就把书里面的配置文件和源码,复制到MyEclipse下面的一个新web项目中,运行,嗨真下行了,这说明下,那<propertyname="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>"test"数据库,必须是先建立的,要不是会报connection 打不开的错误。于是接着运行下我之前写的那郁闷项目,嘿,居然也行了。我也很郁闷啊,之前不一样的配置么,怎么现在就行了呢!!!
我贴下源码 和配置文件吧,大侠 帮忙看下到底是咋啦,
一:hibernate.cfg.xml文件<?xml version='1.0' encoding='GBK'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>
    <session-factory>
      <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- 指定连接数据库的url,hibernate连接的数据库名 -->
<property name="connection.url">jdbc:mysql://localhost/tt</property>
       <!-- 数据库用户名 -->
        <property name="connection.username">root</property>
       <!-- 数据库密码 -->
       <property name="connection.password">108226</property>
        <!--用c3p0连接池连接所允许的最大连接数-->
        <


相关文档:

用C写的3D迷宫

          Boss说,要看OpenGL,看了快一个月,总算出了个像样的东西,用C写了个3D迷宫,
虽然只有350行
       代码,不过边学边写,足足写了一周时间,还是小有成就感的,活活活!
         &n ......

C# 操作MySQL数据库的简单例子

示例演示了用C#操作MySQL的方法,提供了三个可重用的类MySqlDBUtil,MySqlPageUtil,Page。
本示例由 C#操作Access数据库的简单例子(http://www.albertsong.com/read-56.html)修改而来。
1.首先下载MySQL数据库的.NET驱动
http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.0.8.1-noinstall.zip/ ......

Facts of C Programming Language

Facts of C Programming Language
C的一些掌故
(英文原文:http://www.programmingfacts.com/2009/12/01/facts-of-c-programming-language/)
C programming language was developed in 1972 by Dennis Ritchie and Brian Kernighan at the Bell Telephone Laboratories (AT&T Bell Laboratories) for use with the Un ......

linux下安装PHP APACHE MYSQL 手记

/**********************************
APACHE
***********************************/
编辑参数:
./configure" \
"--prefix=/usr/local/apache" \
"--enable-so" \
"--enable-ssl" \
"--enable-mods-shared=most" \
"--with-mpm=event" \
"--with-ssl=/usr/local/openssl" \
"--enable-cache" \
"--enable-mem- ......

Spring配C3P0连接池(以MySQL数据库配置为例)

<?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:jee="http://www.springframework.org/schema/jee"
      &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号