/*点击上传*/
function cilckImport() {
$("#avatsel1").click(function(){
$("#uploadToImportFile").trigger('click');
});
$("#uploadToImportFile").change(function(){
$("#uploadToImportFile").val($(this).val());
});
}
/*上传excel文件*/
var AllXlsExt=".xls|.xlsx|"//全部图片格式类型
function contactAjaxXlsUpload(){
var fileName=$("#uploadToImportFile").filebox('getValue');
var FileExt=fileName.substr(fileName.lastIndexOf(".")).toLowerCase();
if(fileName.trim()==""){
alert("请选择excel文件");
return;
}
if(AllXlsExt.indexOf(FileExt+"|") ==-1){
alert("请选择xls,xlsx格式的文件");
return;
}
//当文件正在上传时,弹出正在加载的弹出框,防止多次上传图片
load();
$.ajaxFileUpload({
url:"${pageContext.request.contextPath}/couponsSend/uploadXls2.action",
secureuri:false, //是否启用安全提交,默认为false
fileElementId:"avatsel1", //文件选择框的id属性
dataType:'text', //服务器返回的格式,可以是json或xml等
success:function(result){ //服务器响应成功时的处理函数
var result = eval('(' + result + ')');
if(result.status=="true"){
$.messager.alert('提示',"成功导入 "+result.data.successNum+" 条数据");
$("#customerPhones").textbox("setValue", result.data.msg);
}else {
$("#importFailedTable").html("
失败序号:
失败原因
");
uploadExcelStatus = 1;
if (result.data.numsList != null) {
$("#ifShow").val(1);
$.each(result.data.numsList, function (commentIndex, comment) {
var importFailedTable = $("#importFailedTable");
var tr = "
" + commentIndex + "
" + comment + "
";
importFailedTable.append(tr);
});
$("#couponSend-dd").dialog({
modal: true,
minimizable: false,//最小化,默认false
maximizable: false, //最大化,默认false
collapsible: false, //可折叠,默认false
resizable: true //可缩放,即可以通脱拖拉改变大小,默认false
}).dialog("open").dialog('setTitle', '导入失败详情');
$("#couponSend-dd").show();
couponsSendDialog.dialog('close');
}
}
}
});
}
jQuery.extend({
createUploadIframe: function(id, uri) {
//create frame
var frameId = 'jUploadFrame' + id;
var iframeHtml = '';
jQuery(iframeHtml).appendTo(document.body);
return jQuery('#' + frameId).get(0);
},
createUploadForm: function(id, fileElementId, data) {
//create form
var formId = 'jUploadForm' + id;
var fileId = 'jUploadFile' + id;
var form = jQuery('');
if(data){
for(var i in data){
jQuery('').appendTo(form);
}
}
var oldElement = jQuery('#' + fileElementId);
var newElement = jQuery(oldElement).clone();
jQuery(oldElement).attr('id', fileId);
jQuery(oldElement).before(newElement);
jQuery(oldElement).appendTo(form);
//set attributes
jQuery(form).css('position', 'absolute');
jQuery(form).css('top', '-1200px');
jQuery(form).css('left', '-1200px');
jQuery(form).appendTo('body');
return form;
},
ajaxFileUpload: function(s) {
// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout
s = jQuery.extend({}, jQuery.ajaxSettings, s);
var id = new Date().getTime()
var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
var io = jQuery.createUploadIframe(id, s.secureuri);
var frameId = 'jUploadFrame' + id;
var formId = 'jUploadForm' + id;
// Watch for a new set of requests
if ( s.global && ! jQuery.active++ ) {
jQuery.event.trigger( "ajaxStart" );
}
var requestDone = false;
// Create the request object
var xml = {}
if ( s.global )
jQuery.event.trigger("ajaxSend", [xml, s]);
// Wait for a response to come back
var uploadCallback = function(isTimeout) {
var io = document.getElementById(frameId);
try{
if(io.contentWindow) {
xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
}else if(io.contentDocument){
xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
}
}catch(e){
jQuery.handleError(s, xml, null, e);
}
if ( xml || isTimeout == "timeout"){
requestDone = true;
var status;
try {
status = isTimeout != "timeout" ? "success" : "error";
// Make sure that the request was successful or notmodified
if ( status != "error" ){
// process the data (runs the xml through httpData regardless of callback)
var data = jQuery.uploadHttpData( xml, s.dataType );
// If a local callback was specified, fire it and pass it the data
if ( s.success )
s.success( data, status );
// Fire the global callback
if( s.global )
jQuery.event.trigger( "ajaxSuccess", [xml, s] );
} else
jQuery.handleError(s, xml, status);
} catch(e){
status = "error";
jQuery.handleError(s, xml, status, e);
}
// The request was completed
if( s.global )
jQuery.event.trigger( "ajaxComplete", [xml, s] );
// Handle the global AJAX counter
if ( s.global && ! --jQuery.active )
jQuery.event.trigger( "ajaxStop" );
// Process result
if ( s.complete )
s.complete(xml, status);
jQuery(io).unbind()
setTimeout(function(){
try{
jQuery(io).remove();
jQuery(form).remove();
} catch(e) {
jQuery.handleError(s, xml, null, e);
}
}, 100)
xml = null
}
}
// Timeout checker
if ( s.timeout > 0 ) {
setTimeout(function(){
// Check to see if the request is still happening
if( !requestDone ) uploadCallback( "timeout" );
}, s.timeout);
}
try {
var form = jQuery('#' + formId);
jQuery(form).attr('action', s.url);
jQuery(form).attr('method', 'POST');
jQuery(form).attr('target', frameId);
if(form.encoding){
jQuery(form).attr('encoding', 'multipart/form-data');
}else{
jQuery(form).attr('enctype', 'multipart/form-data');
}
jQuery(form).submit();
} catch(e){
jQuery.handleError(s, xml, null, e);
}
jQuery('#' + frameId).load(uploadCallback );
return {abort: function () {}};
}
})
工具实体类UploadXlsVo :
public class UploadXlsVo {
private String msg;
private List nums;
private Map numsList;
private Integer successNum;
public Integer getSuccessNum() {
return successNum;
}
public void setSuccessNum(Integer successNum) {
this.successNum = successNum;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List getNums() {
return nums;
}
public void setNums(List nums) {
this.nums = nums;
}
public Map getNumsList() {
return numsList;
}
public void setNumsList(Map numsList) {
this.numsList = numsList;
}
}
控制器controller:
/**
* poi操作excel
* @param request
* @param response
* @return
* @throws Exception
*/
@RequestMapping(value = "/uploadXls2")
@ResponseBody
public Result uploadXls2(HttpServletRequest request, HttpServletResponse response) throws Exception{
Result result = new Result();
UploadXlsVo uploadXlsVo = couponsSendService.uploadXls(request,response);
if (uploadXlsVo.getNumsList()!=null) {
result.setStatus("false");
result.setData(uploadXlsVo);
return result;
}else {
result.setData(uploadXlsVo);
result.setStatus("true");
return result;
}
}
openjdk上关于hotspot将移除永久带的描述非常详细,http://openjdk.java.net/jeps/122
JEP 122: Remove the Permanent Generation
Author Jon Masamitsu
Organization Oracle
Created 2010/8/15
Updated 2011/
PL/SQL也是一门高级语言,所以流程控制是必须要有的,oracle数据库的pl/sql比sqlserver数据库要难,很多pl/sql中有的sqlserver里面没有
流程控制;
分支语句 if 条件 then 结果 else 结果 end if ;
条件语句 case when 条件 then 结果;
循环语句 loop
/*
*开发子程序
*/
--子程序目是指被命名的PL/SQL块,这种块可以带有参数,可以在不同应用程序中多次调用
--PL/SQL有两种类型的子程序:过程和函数
--开发过程
--建立过程:不带任何参数
CREATE OR REPLACE PROCEDURE out_time
IS
BEGIN
DBMS_OUTPUT.put_line(systimestamp);
E
long 长的
show 给...看,出示
mouth 口,嘴
write 写
use 用,使用
take 拿,带来
hand 手
clever 聪明的
often 经常
wash 洗
slow 慢的
house 房子
water 水
clean 清洁的
supper 晚餐
out 在外
face 脸,