mySQLÑÓ³Ù
ÔÚÖ÷Íâ¼ü±í´æÔÚ¹ØϵµÄʱºòÈç¹û¼ÓÉÏ"lazy=true"µÄ»°£¬Ôò±íÃ÷ÑÓ³Ù£¬¼´Ö»²éѯÖ÷±íÖеÄÄÚÈÝ£¬¶ø²»²éѯÍâ¼ü±íÖеÄÄÚÈÝ¡£
Àý£º
<hibernate-mapping>
<class name="com.pojo.Sortp" table="sortp" catalog="shjdc">
<id name="id" type="java.lang.Integer">
<column name="Id" />
<generator class="assigned" />
</id>
<property name="name" type="java.lang.String">
<column name="Name" length="40" not-null="true" />
</property>
<set name="productses" inverse="true" cascade="all" lazy="true">
<key>
<column name="Sortid" not-null="true" />
</key>
<one-to-many class="com.pojo.Products" />
</set>
</class>
</hibernate-mapping>
Ò»°ãÇé¿öϾÍÊÇ°ÑlazyÉèΪtrue£¬¶ø²»ÊÇfalse£¬ÒòΪ£¬¼ÙÈçÉèΪfalseµÄ»°£¬ÔÚÖ´ÐвéѯÖ÷±íµÄͬʱ£¬ÏàÓ¦µÄ×Ó±íÒ²»á²éѯ£¬Ìí¼ÓÁËÐí¶àÎÞÓù¦¡£
Ïà¹ØÎĵµ£º
½¨Á¢Ìõ¼þÊ×ÏÈÒ»¶¨ÒªÈ·¶¨×Ô¼ºµÄmysql£¬tomcat,eclipseÁ¬½ÓÊÇÕýÈ·µÄ¡£
index.jspºÜ¼òµ¥£¬¾ÍÒ»¸öÌøת¡£
<%
response.sendRedirect("lg.jsp");
%>
lg.jsp ʵÏֵǼ¿ò¼Ü
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
<title>
login
</title>
</hea ......
±¾ÎÄʵÀý£¬ÔËÐÐÓÚ MySQL 5.0 ¼°ÒÔÉÏ°æ±¾¡£
MySQL ¸³ÓèÓû§È¨ÏÞÃüÁîµÄ¼òµ¥¸ñʽ¿É¸ÅÀ¨Îª£º
grant ȨÏÞ on Êý¾Ý¿â¶ÔÏó to Óû§
Ò»¡¢grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû¡£
grant select on testdb.* to common_user@'%'
grant insert on testdb.* to common_user@'%'
grant update o ......
ÒÔÏÂÊÇÍêÕûµÄÀý×Ó¡£
1¡¢Ð½¨±í
#title: ×Ô¶¨Òå×Ö·û
#auther: Сǿ(Õ¼²·Ê¦)
#date:
2008
-
01
-08
drop
table
if
exists
Category;
create
table
Category
(
cateId &nbs ......
1¡¢È·¶¨Êý¾Ý¿âĬÈϱàÂ룬±ÈÈç±àÂëΪutf8,½«¶ÁÈë;¾¶±àÂëͬÑùÉèΪutf8£¬ÃüÁîΪ£ºset names utf8;
2¡¢source d:/20080613.sql µ¼ÈëÊý¾Ý¡£ÑéÖ¤Êý¾Ý¿âÖеÄÊý¾ÝÊÇ·ñ´æÔÚÂÒÂë¡£
3¡¢Èç¹ûÈÔÈ»´æÔÚÂÒÂëÎÊÌ⣬Õâʱºò¾ÍÒª¿¼ÂǸı䵼ÈëÎļþµÄ±à ......