Time of Update: 2018-12-04
上一個例子是一個基礎的HIbernate的CRUD,不過用的是hbm.xml映射持久化類;這裡將第一個例子稍作改動,改為annotation的,使用註解可以免去持久化類的設定檔。step1:修改Student持久化類:package model;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.GeneratedValue;import
Time of Update: 2018-12-04
Schema:"A schema is a collection of logical structures of data, or schema objects. A schema is owned by a database user and has the same name as that user. Each user owns a single schema.
Time of Update: 2018-12-04
今天要用到一個圖片上傳的,聽說Struts2就是用的這個,啃了啃鷹文文檔,實驗了下common-fileupload實驗成功了,記錄下:Servlet裡doPost()方法貼出:/** 大致步驟為: * 1.準備FileItem工廠; * 2.把工廠交給ServletFileUpload,讓他把前端的表單條條資訊解析; * 3.處理解析好返回的列表中的每一個具體項 */@SuppressWarnings("unchecked")@Overrideprotected void
Time of Update: 2018-12-04
public class IsoscelesTriangle {/** * 等腰三角形 */ public void print1(){//形如 ▲向上的 for(int i=1;i<=5;i++){ for(int k=1;k<=5-i;k++) System.out.print(" "); for(int j=1;j<=2*i-1;j++)
Time of Update: 2018-12-04
/* --------------------------POST------------->http://192.168.1.211:8080/demo/index.jspusername=qqqqpassword=wwwwemail=1063128263@qq.com發送請求!
Time of Update: 2018-12-04
Schema Vs. UserTechnically, a schema is a collection of database objects owned by a specific user. Those objects include tables, indexes, views, stored procedures, etc. In Oracle, a schema requires a user to be created. But you can create a user
Time of Update: 2018-12-04
1.servlet接受request:<1>發送:頁面action="login"<2>接受:web.xml中配置LoginServlet:"/login"2.struts接受request:<1>發送:頁面action="login"<2>接受:struts.xml配置<action name="login" class="action.LoginAction"><result name="success">/hello.
Time of Update: 2018-12-04
多對一映射簡例:1.我使用學生和地址的關係來做樣本:student[s_id,s_name,s_addr]address[a_id,city]2.建立資料庫表:create table address(a_idint(10)auto_incrementprimary key,cityvarchar(16))engine=MyISAM CHARACTER SET=utf8;create table student(s_idint(10)auto_incrementprimary
Time of Update: 2018-12-04
RowCallBackHandler 是 JdbcTemplate 的 query 方法中用到的一個介面。介面,基於每一行,用來處理ResultSet結果集的行。它只有一個方法: void processRow(ResultSet rs) throws SQLException; 如果自己要實現這個方法,就要做到處理ResultSet結果集中的每行的資料,你不能在方法中再去調用next()方法,而應該只是提取當前行的資料。 例如: @Overridepublic User
Time of Update: 2018-12-04
由於自己的eclipse設定時UTF8,匯入別人寫的代碼,全是亂碼。在eclipse下又發現不了gbk,於是寫了個工具轉換。不支援目錄迭代。package com.iteye.niewj.util;import java.io.BufferedReader;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import
Time of Update: 2018-12-04
List cats = session.createCriteria(Cat.class) .add( Restrictions.like("name", "Iz%") ) .add( Restrictions.gt( "weight", new Float(minWeight) ) ) .addOrder( Order.asc("age") ) .list(); List cats = session.createCriteria(Cat.class)
Time of Update: 2018-12-04
1. 電話裡面“This is a wrong number.Please check up and take the telephone number again…….”; 電話外面“孩子,你為什麼每天都說外語,媽聽不懂,但是媽想你……..” (親情是這麼的美。)2. 女孩說:我懷孕了。
Time of Update: 2018-12-04
/*Navicat MySQL Data TransferSource Server : connectionSource Server Version : 60011Source Host : localhost:3306Source Database : hibnieTarget Server Type : MYSQLTarget Server Version : 60011File Encoding :
Time of Update: 2018-12-04
正在學習jquery,之前在windows下弄的編碼到了 ubuntu下,亂碼;找到一個方法:iconv :源檔案:a.htm 格式:gbk;目標: a.html 格式:utf8;iconv -f=gbk -t=utf8 a.htm -o a.html----------------------------------------------輸入/輸出格式規範: -f, --from-code=名稱 原始文本編碼 -t, --to-code=名稱 輸出編碼 資訊:
Time of Update: 2018-12-04
對java的String類的一些小補充。public class StringUtil { /** 將一個字串的首字母大寫然後返回. @param str 要處理的目標字串. @returnString new String(cs) */ public static String capitalize(String str) { char[] cs = str.trim().toCharArray(); cs[0] =
Time of Update: 2018-12-04
剛剛遇到一個問題,程式處理完Excel之後,發現sheet的序號排序亂了,問過穀老師,拿到一個答案,貼出這段指令碼,做為備份。 Sub Sorting()Dim sCount As Integer, i As Integer, j As IntegerApplication.ScreenUpdating = FalsesCount = Worksheets.CountIf sCount = 1 Then Exit SubFor i = 1 To sCount - 1For j = i + 1
Time of Update: 2018-12-04
焦時間點事件FocusListener有如下兩個方法:focusGained() 得到焦點觸發focusLost() 失去焦點觸發舉例:package com.iteye.niewj.swt.chapter1;import org.eclipse.swt.SWT;import org.eclipse.swt.events.FocusEvent;import org.eclipse.swt.events.FocusListener;import
Time of Update: 2018-12-04
此文章來自CSDN論壇。文章源地址:http://topic.csdn.net/u/20100519/11/F95C3502-A4CE-461D-95CD-EFB06676378A.html#r_65546638 這兩個項目都開發不夠成熟,但是最主要的區別在以下幾個方面:1.CXF支援 WS-Addressing,WS-Policy, WS-RM, WS-Security和WS-I Basic Profile。Axis2不支援WS-Policy,但是承諾在下面的版本支援。2.
Time of Update: 2018-12-04
SelectionListener是最常用的事件監聽器。有兩個方法:widgetSelected和widgetDefaultSelectdwidgetSelected監聽的事件包括:button被單擊或組件被選中時。widgetDefaultSelected監聽的事件包括【較少用到的】:文字框斷行符號事件,列表框斷行符號事件 一個按鈕單擊的例子:package com.iteye.niewj.swt.chapter1;import
Time of Update: 2018-12-04
有好幾個地方:1.JSP設定 contentType2.Filter:utf8 request.setCharacterEncoding()3.Tomcat server.xml:<Connector useBodyEncodingForURI="true" /> 也可URIEncoding="UTF-8"http://tomcat.apache.org/tomcat-7.0-doc/config/http.htmlURIEncodingThis specifies the