会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
长456风
上一页
1
···
7
8
9
10
11
12
13
14
15
···
22
下一页
2015年6月4日
hibernate更新
摘要: 1、使用对象更新 public void updateImagePath(Weibo weibo){ Session session = HibernateUtil.currentSession(); try { Transaction tx = session.beginTransa...
阅读全文
posted @ 2015-06-04 21:16 长456风
阅读(206)
评论(0)
推荐(0)
让hibernate支持mysql的text或者longtext
摘要: public class CustomDialect extends MySQL5Dialect { public CustomDialect() { super(); registerHibernateType(Types.DECIMAL, Hiber...
阅读全文
posted @ 2015-06-04 20:46 长456风
阅读(1116)
评论(0)
推荐(0)
hibernate的查询
摘要: 1、条件查询 public List selectOne(int k){ Session session = HibernateUtil.currentSession(); try { Criteria c=session.createCriteria(Weibo.class); ...
阅读全文
posted @ 2015-06-04 20:46 长456风
阅读(136)
评论(0)
推荐(0)
2015年6月3日
微博获取原图时重定向到图片的url
摘要: 微博获取原图时重定向到图片的url,所以获取的是乱码 jsoup默认是执行重定向的。//根据Url获取页面对应的Document public static Document getDoc1(String url){ Document doc = null; try { Connec...
阅读全文
posted @ 2015-06-03 16:41 长456风
阅读(633)
评论(0)
推荐(0)
2015年6月1日
java判断字符串编码
摘要: public class JudgeCode { public static String getEncoding(String str) { String encode = "GB2312"; try { if (str.equals(new String(str.getBytes(...
阅读全文
posted @ 2015-06-01 19:16 长456风
阅读(488)
评论(0)
推荐(0)
循环监听事件出错,只能监听最后一个
摘要: (function(){ var i= 0; for (;i<value;i=i+1){ (function(j){ var flip_id = "#flip"+i+""; var panel_id = "#panel"+i+"";...
阅读全文
posted @ 2015-06-01 19:11 长456风
阅读(305)
评论(0)
推荐(0)
爬取微博存入数据库时出错
摘要: 微博内容为utf-8编码,但是其中有部分特殊字符,无法存入数据库。先将其写入txt文件,再存入数据库,无错。证明存入txt过程中有转码操作。 用下面转码即可实现。 byte[] b = text.getBytes("utf-8");//编码 text = new String(b, "utf...
阅读全文
posted @ 2015-06-01 19:11 长456风
阅读(151)
评论(0)
推荐(0)
org.hibernate.AssertionFailure: null id don't flus
摘要: 我的是字段编码和数据库不匹配,是爬的微博数据
阅读全文
posted @ 2015-06-01 15:26 长456风
阅读(151)
评论(0)
推荐(0)
eclipse有时候导入了包,但是还是有红线,找不到
摘要: clean一下工程,选择project->clean->clean project selected blow并且选择build only the selected project
阅读全文
posted @ 2015-06-01 10:50 长456风
阅读(278)
评论(0)
推荐(0)
2015年5月31日
hibernate注解创建表总是失败,显示表不存在
摘要: import java.io.Serializable;import javax.persistence.*; import org.hibernate.annotations.GenericGenerator;@Entity@Table(name="student")public class ...
阅读全文
posted @ 2015-05-31 19:32 长456风
阅读(641)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
15
···
22
下一页
导航
博客园
首页
新随笔
联系
订阅
管理
公告