mysql verycd_从sqllite中拷贝verycd数据到mysql中,提示内存溢出

publicstaticvoidmain(String[]args)throwsClassNotFoundException,SQLException{//SqlliteConnectionconnection=ReadDataForSqlList.createConnection();PreparedStatementstatement...

public static void main(String[] args) throws ClassNotFoundException, SQLException{//SqlliteConnection connection = ReadDataForSqlList.createConnection();PreparedStatement statement = connection.prepareStatement("select title,status,brief,pubtime,updtime,category1,category2,ed2k,content,related from verycd order by verycdid limit ? offset ?");int pageSize = 10000; //每次读取的行数int pageId=0;//每次读取开始的位置boolean isEmpty =true;statement.setInt(1, pageSize);statement.setInt(2, pageId);ResultSet rs =statement.executeQuery();//MysqlConnection con = WriteDataToMysql.createConnection();PreparedStatement prepare = null;int col =0;int num =0;Date day= null; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); do{if(col==pageSize){ //如果每次读取的行数等于10000则认为数据库中还有数据,则从上次读取结束位置继续读,直至小于10000rs =null;isEmpty =true;col=0;pageId=pageId+pageSize;statement.setInt(1, pageSize);statement.setInt(2, pageId);rs =statement.executeQuery();}else if(col!=pageSize&&pageId!=0&&!rs.next()){isEmpty = true;}else if(col>0&&col

抱歉,代码格式有问题,重新贴了图片

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值