fw_student_SqlMap.xml(SQL ºÍVOµÄÓ³ÉäÎļþ)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="fw_student">
<resultMap class="com.sias.Student" id="student">
<result column="name" property="name" jdbcType="VARCHAR2"/>
<result column="sex" property="sex" jdbcType="VARCHAR2"/>
</resultMap>
<select id="Select" resultMap="student">//±»SqlMapClientÀàµÄList queryForList(String)·½·¨µ÷ÓÃ
select name,sex from fw_student
</select>
<insert id="insert" parameterClass="com.sias.Student">//±»SqlMapClientÀàµÄ void insert(String,Object)·½·¨µ÷ÓÃ
insert into fw_student(name,sex) values(#name:VARCHAR2#,#sex:VARCHAR2#)
</insert>
<update id="update" parameterClass="java.util.Map">//±»SqlMapClientÀàµÄ void update(String,Map)·½·¨µ÷ÓÃ
update fw_student cm set name='chang'
<isPropertyAvailable property="n">//Èç¹ûMap.put(String,value)ÖдæÔÚ±äÁ¿n(String="n"),ÔòʹÓÃWhere name=n;
where name='$n$'
</isPropertyAvailable>
</update>
</sqlMap>
ÕâÀïÐèҪ˵Ã÷µÄÊÇ$ºÍ#·ûºÅµÄÓ÷¨£º
ÀýÈç±äÁ¿MÊÇ×Ö·û´®ÀàÐÍ,ÔòÓ¦¸ÃÓÃ'$M$'»òÕß#M#,Èç¹ûÊÇintÐÍ£¬ÔòÓÃ$M$»ò#M#
Ïà¹ØÎĵµ£º
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ
CHAR
CHAR
¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ
VARCHAR2
VARCHAR
OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´®
NCHAR
NCHAR
Ç°Õß×î´ó³¤¶È2kbºóÕß×î´ó³¤¶È4 ......
½ÓÉÏƪ
ËÄ£¬¸ù¾ÝÌõ¼þÓÐÑ¡ÔñµÄUPDATE¡£
Àý£¬ÓÐÈçϸüÐÂÌõ¼þ
¹¤×Ê5000ÒÔÉϵÄÖ°Ô±£¬¹¤×ʼõÉÙ10%
¹¤×ÊÔÚ2000µ½4600Ö®¼äµÄÖ°Ô±£¬¹¤×ÊÔö¼Ó15%
ºÜÈÝÒ׿¼ÂǵÄÊÇÑ¡ÔñÖ´ÐÐÁ½´ÎUPDATEÓï¾ä£¬ÈçÏÂËùʾ
--Ìõ¼þ1
UPDATE Personnel
SET salary = salary * 0.9
WHERE salary >= 5000;
--Ìõ¼þ2
UPDATE Personnel
SET sala ......
±¾ÎÄ×ܽáÁËÔÚPythonÖÐÖ÷ÒªµÄ¼¸ÖÖ´¦ÀíXMLµÄ·½·¨£º
Element Tree
SAX
Dom
ʹÓõÚÈý·½Àà¿âÈçAmara 2.x£¬ libxml2dom µÈ
Element Tree
Element TreeÊÇPython 2.5ÒýÈëµÄʹÓüòµ¥£¬¿ì½ÝµÄ´¦Àí·½·¨£¬ Ò²ÊÇPython±ê×¼Àà¿âÍƼöµÄ´¦ÀíXMLµÄ·½·¨¡£
ËüʹÓÃÊ÷ÐνڵãµÄÐÎʽÀ´¶ÁдXML¡£Element TreeÊÇÇáÁ¿¼¶µÄDOM£¬ ËùÒÔÊ ......
data.xml
<?xml version="1.0" encoding="UTF-8"?>
<Items>
<Item ASIN="0446355453"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="Master of the Game"/>
<Item ASIN=" ......
ÒÑÖªÒ»¸ö±íµÄ½á¹¹Îª£º
ÐÕÃû ¿ÆÄ¿ ³É¼¨
ÕÅÈý ÓïÎÄ 20
ÕÅÈý Êýѧ 30
ÕÅÈý Ó¢Óï 50
ÀîËÄ ÓïÎÄ 70
ÀîËÄ Êýѧ 60
ÀîËÄ Ó¢Óï 90
ÔõÑùͨ¹ýselectÓï¾ä°ÑËû±ä³ÉÒÔϽṹ£º
ÐÕÃû ÓïÎÄ Êýѧ Ó¢Óï
ÕÅÈý 20 30 50
ÀîËÄ 70 60 90
´ð:
CREATE TABLE [dbo].[Stu] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Name] ......