<%@ taglib PRefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>1.<sql:setDataSource>設置數據源
<sql:setDataSource url="jdbc:MySQL://localhost:3306/xxx"driver="com.mysql.jdbc.Driver"user=""passWord=""/>var設置變量名稱,scope設置范圍,默認page,沒有var,就是scope默認的數據源。2.<sql:query>
sql:select語句dataSource:數據源,沒有就默認。maxRows:從原始查詢結果中取出的最大數目startRow:從哪行開始讀結果記錄,索引從0開始var,scope返回結果為Result類型,有幾個方法String[] getColumnNames():返回所有字段名字int getRowCount:返回所有記錄數目SortedMap[] getRows():返回行Object[][] getRowsByIndex():一維表示行一維表示列boolean isLimitedByMaxRows()原始結果小于等于maxRows返回false.3.<sql:param>用來設置sql語句中?的值??梢郧短自趕ql:query和sql:update中。4.<sql:dataParam>跟上面一樣是設置值的,只不過是設置的時間值value:date類型
type:date,time,timestamp(默認)
5.<sql:update>
sql:update,insert,delete等語句。dataSource:數據源var::受影響記錄數。scope:范圍6:.<sql:transaction>事務,可以包含多個query和updatedataSource:數據源,這里面的query和update不用設置數據源了。
isolation:隔離級別。
1.serializable:串行化。
2.repeatable_read:可重復讀
3.read_committed:讀已提交數據
4.read_uncommitted:讀未提交數據
隔離級別由高到底,并發性能由低到高,一般設置read_committed就行。
<%@ taglib prefic="fn" uri="http://java.sun.com/jsp/jstl/functions"%>1.fn:contains(String source,String target)判斷是否包含字符串${fn:contains("Tomcat","cat")}//true${fn:contains("Tomcat","CAT")}//false2.fn:containsIgnoreCase(String source,String target)判斷是否包含字符串,忽略大小寫3::fn:startsWith(String source,String target)判斷是否以某個字符串開頭。
4::fn:endsWith(String source,String target)判斷是否以某個字符串結尾。
5::fn:indexof(String source,String target)返回包含字符串第一字符的索引。沒有就返回-1
6::fn:replace(String source,String before,String after)把source中的before替換成after
7.fn:substring(String source,int beginIndex,int endIndex)endIndex為最后一個字符所在位置加1
fn:substring("Tomcat",0,4)//Tom8.fn:substringBefore(String source,String target)返回target在source之前的字符串,沒有就返回空字符串9.fn:substringAfter(String source,String target)返回source中在target之后的字符串,沒有就返回空字符串
10.fn:split(String source,String delimiter)分割字符串,參數為null或者沒有分割字符串的字符,就返回原字符串。
11.fn:join(String[] source,String separator)合并字符串,中間用separator連接。
12.fn:toLowerCase(String source)轉為小寫。
13.fn:toUpperCase(String source)轉為大寫。
14.fn:trim(String source)去掉首尾空格
15.fn:escapexml(String source)特殊字符轉譯“<>”等等
16.fn:length(source)返回字符串,集合數組的長度。
新聞熱點
疑難解答