Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

hibernateÔÚMYSQLÖеÄʹÓÃ

Hibernate ÅäÖÃͨ¹ýc3p0Á¬½ÓMYSQL
** ÐèÒªµÄ°ü: c3p0_versionxx.jar
** 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">
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>
<session-factory>
    <property name="connection.url">jdbc:mysql://localhost:3306/spring</property>
    <property name="connection.username">root</property>
    <property name="connection.password">fangjean</property>
    <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="connection.useUnicode">true</property>
    <property name="connection.characterEncoding">UTF-8</property>
   
    <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    <property name="hibernate.c3p0.max_size">20</property>
    <property name="hibernate.c3p0.min_size">5</property>
    <property name="hibernate.c3p0.timeout">120</property>
    <property name="hibernate.c3p0.max_statements">100</property>
    <property name="hibernate.c3p0.idle_test_period">120</property>
    <property name="hibernate.c3p0.acquire_increment">2</property>
   
    <property name="dialect">org.hibernate.


Ïà¹ØÎĵµ£º

java µ÷ÓÃÃüÁî ±¸·ÝmysqlÊý¾Ý¿â

 ´úÂëÈçÏ£º
  1  String command  =   " cmd /c C:/Program Files/MySQL/MySQL Server 5.0/bin>mysqldump -h localhost -u root -p aijia > E:/aijia.dmp " ;
  2      try    {
  3     Process process& ......

mysql date

ÈÕÆÚº¯Êý£º
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html
http://hi.baidu.com/yase_guoguo/blog/item/171c2d4feea83c01b2de0527.html
SQL ʱ¼ä±È½Ï
select * from useroperation where '2009-10-26 00:00:00' < date;  //dateµÄÀàÐÍÊÇdatetime
select * from useroperation where D ......

mysqlÈÝÒ×±»ºöÂÔµÄÓ÷¨

1.ÔÚ´´½¨±íµÄͬʱ´´½¨Ë÷Òý
  CREATE TABLE material(id INT NOT NULL, name char(40) NOT NULL, resistance INT, INDEX index1(id,name), UNIQUE INDEX index2(name))
  µÚÒ»¸öË÷Òý£¬ÃûΪindex1£¬ÓÉidºÍnameÁ½¸ö×Ö¶Î×é³É¡£µÚ¶þ¸öË÷ÒýÖ»°üº¬name£¬²¢Ö¸Ã÷name×ֶεÄÖµ±ØÐëÊÇΨһµÄ¡£
2.²åÈëÊý¾Ý£¬¿ÉÒÔͨ¹ýÆäËûij ......

MySQLÖÐInnoDBºÍMyISAMµÄ²î±ð

InnoDBºÍMyISAMÊÇÔÚʹÓÃMySQL×î³£ÓõÄÁ½¸ö±íÀàÐÍ£¬¸÷ÓÐÓÅȱµã£¬ÊÓ¾ßÌåÓ¦Óöø¶¨¡£ÏÂÃæÊÇÒÑÖªµÄÁ½ÕßÖ®¼äµÄ²î±ð£¬½ö¹©²Î¿¼¡£
innodb 
      InnoDB ¸ø MySQL ÌṩÁ˾ßÓÐÊÂÎñ(commit)¡¢»Ø¹ö(rollback)ºÍ±ÀÀ£ÐÞ¸´ÄÜÁ¦(crash recovery capabilities)µÄÊÂÎñ°²È«(transaction-safe (ACID complian ......

mysql ÈÕÆÚĬÈÏϵͳʱ¼ä mysql ĬÈÏÖµ²»Ö§³Öº¯Êý

ÓÉÓÚMySQLÄ¿Ç°×ֶεÄĬÈÏÖµ²»Ö§³Öº¯Êý£¬ËùÒÔÒÔ
create_time datetime default now()
µÄÐÎʽÉèÖÃĬÈÏÖµÊDz»¿ÉÄܵġ£
´úÌæµÄ·½°¸ÊÇʹÓÃTIMESTAMPÀàÐÍ´úÌæDATETIMEÀàÐÍ¡£
TIMESTAMPÁÐÀàÐÍ×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£
Èç¹ûÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ