bingdongsanxian的博客
bingdongsanxian · 共 9 篇文章
mysql常用函数
一、数学函数 ABS(x) 返回x的绝对值 BIN(x) 返回x的二进制(OCT返回八进制,HEX返回十六进制) CEILING(x) 返回大于x的最小整数值 EXP(x) 返回值e(自然对数的底)的x次方 FLOOR(x) 返回小于x的最大整数值 GREATEST(x1,x2,...,xn)返回集合中最大的值 LEAST(x1,x2,...,xn) 返回集合中最小的值 LN(x) 返回x的自然对数 LOG(x,y)返回x的以y为底的对数 MOD(x,y) 返回x/y的模(余数) PI()返回pi的值(圆周率) RAND()返回0到1内的随机值,可以通过提供一个参数(种子)使RAND()随机…
2017-05-12T17:13:45Z · 数据库 · 评论(0)
下载文件
@RequestMapping("/downLoadFile") public String downLoadFile(HttpServletResponse response,HttpServletRequest request) throws Exception { try { String basePath = request.getSession().getServletContext().getRealPath("/"); String fileName= "模板.doc" File file = new File(basePath +fileName); String agent…
2016-09-14T11:28:07Z · 编程语言 · 评论(0)
系统间的直连通讯
发送端: HttpClient httpClient = new HttpClient(); //org.apache.commons.httpclient.HttpClient PostMethod method = new PostMethod(connecturl);//org.apache.commons.httpclient.methods.PostMethod method.setParameter("version", "1.0"); method.setParameter("service", "reapal.trust.onekeyRefund"); method.setP…
2015-12-04T09:54:27Z · 编程语言 · 评论(0)
非网关形式的post方式提交至另一系统
本系统代码: public void paynotify(){ String reqxml=util.createXMLxfb(resmap, list); String resxml=Clientnew.httpParameterStream(url, reqxml); } // http发送报文方法 public class Clientnew { public static String httpParameterStream(String surl,String parameter)throws Exception{ String str = ""; try{ System.out.…
2015-12-02T18:35:22Z · 编程语言 · 评论(0)
blob存取数据库
将图片以blob存入数据库 public String uploadfile() { try { HttpServletResponse response = ServletActionContext.getResponse(); HttpServletRequest request = ServletActionContext.getRequest(); String path = request.getContextPath(); Blob photo = null; String basePath = request.getScheme() + "://"+ request.getSe…
2015-10-29T17:43:40Z · 编程语言 · 评论(0)
上传文件时用二进制存取数据库,以及文件上传
1、Action类: public class EnterpriseAction extends BaseAction { //此方法主要是将数据库里文件二进制转为文件存放在服务器某路径下 public void initorgimg(ScFile file,String reqattr){ HttpServletRequest request = getRequest(); // 获取存放路径 String savePath = ServletActionContext.getServletContext().getRealPath("/"); savePath = savePath.re…
2015-08-28T19:42:24Z · 编程语言 · 评论(0)
项目启动不报错,却访问不到项目
项目启动不报错,从浏览器里却访问不到项目,原因可能如下: 1、jdk是32位,而struts配置文件头部配的是 此时,需把2.3改为2.0
2015-08-19T17:35:36Z · 编程语言 · 评论(0)
struts配置和jsp中刷新页面
1、 默认的国际化地区信息。 2、 该属性指定Struts 2应用所需要的国际化资源文件,如果有多份国际化资源文件,则多个资源文件的文件名以英文逗号(,)隔开。 3、<s:url>标签 项目目录:web/admin/default.jsp页面中使用: 其中,关于 的几点说明: 1)该句话用于页面定期刷新,如果加url的,则会重新定向到指定的网页,content后面跟的是时间(单位秒),把这句话加到指定网页的 里一般也用在实时性很强的应用中,需要定期刷新的页面,如新闻页面,论坛等,不过一般不会用这个,都用新的技术比如ajax等。 2)对于jsp中的<meta http-equiv="refre…
2015-08-15T11:56:31Z · 编程语言 · 评论(0)