修改前:
prepareStatement=this.connection.prepareStatement("insert into weibo values ('"+info.getId()+"','"+info.getName()+"','"+info.getSelf()+"','"+info.getText()+"',
'"+info.getTimestamp() +"',//这里。。。。。
'"+info.getType()+"','"+((Long)this.queryForId(topic)[0]+1)+"','"+topic+"')");
prepareStatement.execute();
//==============================================================
修改后:
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long ts=Long.parseLong(info.getTimestamp())*1000;
prepareStatement=this.connection.prepareStatement("insert into weibo values ('"+info.getId()+"','"+info.getName()+"','"+info.getSelf()+"','"+info.getText()+"',
'"+sdf.format(ts) +"',//这里。。。。。。
'"+info.getType()+"','"+((Long)this.queryForId(topic)[0]+1)+"','"+topic+"')");
prepareStatement.execute();
想问下为啥将时间戳转换为具体的时间格式后,插入数据库的记录被限定为只有100条?
prepareStatement=this.connection.prepareStatement("insert into weibo values ('"+info.getId()+"','"+info.getName()+"','"+info.getSelf()+"','"+info.getText()+"',
'"+info.getTimestamp() +"',//这里。。。。。
'"+info.getType()+"','"+((Long)this.queryForId(topic)[0]+1)+"','"+topic+"')");
prepareStatement.execute();
//==============================================================
修改后:
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long ts=Long.parseLong(info.getTimestamp())*1000;
prepareStatement=this.connection.prepareStatement("insert into weibo values ('"+info.getId()+"','"+info.getName()+"','"+info.getSelf()+"','"+info.getText()+"',
'"+sdf.format(ts) +"',//这里。。。。。。
'"+info.getType()+"','"+((Long)this.queryForId(topic)[0]+1)+"','"+topic+"')");
prepareStatement.execute();
想问下为啥将时间戳转换为具体的时间格式后,插入数据库的记录被限定为只有100条?