关于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连接池连接所允许的最大连接数-->
<
相关文档:
Boss说,要看OpenGL,看了快一个月,总算出了个像样的东西,用C写了个3D迷宫,
虽然只有350行
代码,不过边学边写,足足写了一周时间,还是小有成就感的,活活活!
&n ......
默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆。需要更改权限:
如下的方式确认:
root#mysql -h localhost-u mysql -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connectio ......
C语言中可变参数的用法
我们在C语言编程中会遇到一些参数个数可变的函数,例如printf()
这个函数,它的定义是这样的:
int printf( const char* format, ...);
它除了有一个参数format固定以外,后面跟的参数的个数和类型是
可变的,例如我们可以有以下不同的调用方法:
printf("%d",i);
printf("%s",s);
printf( ......
linux安装mysql.txt
2009-03-22 10:45
一、引言
想使用Linux已经很长时间了,由于没有硬性任务一直也没有系统学习,近日由于工作需要必须使用Linux下的MySQL。本以为有Windows下使用SQL Server的经验,觉得在Linux下安装MySql应该是易如反掌的事,可在真正安装和使用MySQL时走了很多弯路,遇见很多问题,毕竟Linux ......
/**********************************
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- ......