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

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的话,在执行查询主表的同时,相应的子表也会查询,添加了许多无用功。


相关文档:

jsp—MySql制作B/s登陆的好例子 学习笔记

建立条件首先一定要确定自己的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 access deined

我的系统是ubuntu6.06,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
使用网上介绍的方法修改root用户的密码:
# mysqladmin -uroot -p password 'newpassword'
Enter password:
m ......

mysql 创建函数的1418错误解决方案

 Error Code : 1418
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
(0 ms taken)
分析:
根据系统提示,导致该错误的原因可能是一个安全设置方面 ......

MySQL数据库编码问题

      在程序开发中,有时会被字符乱码的问题所困扰。对此,必须理解 MySQL 的字符集编码设置的原理:在MySQL中,默认使用的是lartin1,也就是ISO8859-1字符集编码。这是一种8位的编码,适用于所有西欧字符。而对于汉字等是不合适的。最好、最通用的编码格式是utf-8,UTF-8(8 位元 Universal Cha ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号