自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 ajax与json

ajax发送请求,json返回function checkUserName(){var userName=document.getElementById("userName").value;var xmlHttp;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}else{xmlHttp=new Ac

2017-10-19 15:47:09 161

原创 mybatis缓存

当使用同一个sqlSession条用相同的sql语句时,mybatis默认使用缓存中的sql语句;默认select使用缓存,insert delete update不使用缓存1,size:表示缓存cache中能容纳的最大元素数。默认是1024;2,flushInterval:定义缓存刷新周期,以毫秒计;3,eviction:定义缓存的移除机制;默认是LRU(least

2017-10-19 15:46:23 154

原创 mybatis插入与取出 blob clob字段

Student中 pic字段为blob类型blob clob(mysql中为longtext)映射到java模型分别为 byte[] Stringclob直接插入跟取出 字符串即可;插入blob字段的代码为:Student s = new Student();s.setName("Tom");s.setAge(18);s.setRemark("很长的文本");

2017-10-19 15:45:43 5309

原创 mybatis一对多关联查询

描述:一个班级里面有很多人,通过查找Grade得到里面所有Student的信息跟一对一类似,不同的是Grade里面用类型为List的students 在找到Grade的同时,把主键ID传到StudentMapper.findByGradeId 并调用该方法,查询得到班级的所有学生配置如下:

2017-10-19 15:44:00 184

原创 mybatis一对一

Student类中有引用Address 在查询学生的信息时,把address的信息也查询1.级联查询(少用,重复利用效率低)在mapper配置如下:2.重新定义Address类型,在Student中引入Address(少用,原因同一)3.另外配置AddressMapper在查询S

2017-10-19 15:43:31 273

原创 mybatis

(一 )操作1.自己构建工具类SqlSessionFactory2.在测试类中的代码SqlSession sqlSession = SqlSessionFactoryUtil.openSession();StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);Student s =

2017-10-19 15:42:53 219

原创 SpringMVC文件上传

1.添加bean(必须)class="org.springframework.web.multipart.commons.CommonsMultipartResolver">2.文件上传Controller代码@RequestMapping("/upload")public String uploadFiles(@RequestP

2017-10-19 15:42:16 144

原创 乱码处理

处理方式:配置一个过滤器,将编码改成utf-8characterEncodingFilterorg.springframework.web.filter.CharacterEncodingFilterencodingutf-8characterEncodingFilter*.do

2017-10-19 15:41:46 161

原创 Spring事务管理

(一)编程式事务管理(少用,缺点:代码侵入事务层,改编代码结构)实现方式:把需要进行事务管理的方法放到指定方法中,例如:public void transferAccount(double money, int userA, int userB) {transactionTemplate.execute(new TransactionCallbackWithoutResult(

2017-10-19 15:41:05 126

转载 Spring与JDBC

(一)Spring 配置jdbc模板步骤:1.配置数据源2.配置模板(需要引用到数据源 )3.在事务层注入jdbc模板(需要在事务层提供set方法)(二)配置命名的jdbc模板1.配置数据源2.配置模板(这里运用构造方法注入)3.在

2017-10-19 15:39:56 152

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除