ORA-00018:超出最大会话数[z]

展开阅读全文

oracle 超出最大的游标数?怎么解决?

05-07

[code=Java]rnpublic void insertTraitStrTrees(List list, String tableName) rnrn connect();rn sql = "insert into " + tableName + " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";rn try rn conn.setAutoCommit(false);rn for (int i = 0; i < list.size(); i++) rn System.out.println(tableName+" "+i);rn ps = conn.prepareStatement(sql);rn ps.setInt(1, list.get(i).getDg_id());rn ps.setInt(2, list.get(i).getId());rn ps.setString(3, list.get(i).getTrait_value());rn ps.setInt(4, list.get(i).getParent_id());rn ps.setInt(5, list.get(i).getChild_id());rn ps.setInt(6, list.get(i).getLeft_id());rn ps.setInt(7, list.get(i).getRight_id());rnrn ps.setBlob(8, BLOB.getEmptyBLOB());rn ps.setBlob(9, BLOB.getEmptyBLOB());rn ps.setBlob(10, BLOB.getEmptyBLOB());rn ps.setBlob(11, BLOB.getEmptyBLOB());rn ps.setBlob(12, BLOB.getEmptyBLOB());rn ps.setBlob(13, BLOB.getEmptyBLOB());rn ps.setBlob(14, BLOB.getEmptyBLOB());rnrn ps.setInt(15,list.get(i).isFrist());rn ps.setInt(16,list.get(i).isHasChild());rn ps.executeUpdate();rn String sql1="select articles,pictures,tables,videos,audios,ads,pages from "+tableName+" where dg_id="+list.get(i).getDg_id()+" and id="+list.get(i).getId()+" FOR UPDATE";rn System.out.println(sql1);rn ps=conn.prepareStatement(sql1);rnrn ResultSet rs=ps.executeQuery();rn rs.next();rn BLOB articles=(BLOB)rs.getBlob(1);rn BLOB pictures=(BLOB)rs.getBlob(2);rn BLOB tables=(BLOB)rs.getBlob(3);rn BLOB videos=(BLOB)rs.getBlob(4);rn BLOB audios=(BLOB)rs.getBlob(5);rn BLOB ads=(BLOB)rs.getBlob(6);rn BLOB pages=(BLOB)rs.getBlob(7);rnrn OutputStream out1=articles.getBinaryOutputStream();rn OutputStream out2=pictures.getBinaryOutputStream();rn OutputStream out3=tables.getBinaryOutputStream();rn OutputStream out4=videos.getBinaryOutputStream();rn OutputStream out5=audios.getBinaryOutputStream();rn OutputStream out6=ads.getBinaryOutputStream();rn OutputStream out7=pages.getBinaryOutputStream();rn try rn out1.write(list.get(i).getArticles());rn out1.close();rn out2.write(list.get(i).getPictures());rn out2.close();rn out3.write(list.get(i).getTables());rn out3.close();rn out4.write(list.get(i).getVideos());rn out4.close();rn out5.write(list.get(i).getAudios());rn out5.close();rn out6.write(list.get(i).getAds());rn out6.close();rn out7.write(list.get(i).getPages());rn out7.close();rn catch (IOException ex) rn Logger.getLogger(MysqlDB.class.getName()).log(Level.SEVERE, null, ex);rn rn rn String sql2="update "+tableName+" set articles=? , pictures=? , tables=? , videos=? , audios=? , ads=? , pages=? where dg_id="+list.get(i).getDg_id()+" and id="+list.get(i).getId();rn System.out.println(sql2);rn ps=conn.prepareStatement(sql2);rn ps.setBlob(1, articles);rn ps.setBlob(2, pictures);rn ps.setBlob(3, tables);rn ps.setBlob(4, videos);rn ps.setBlob(5, audios);rn ps.setBlob(6, ads);rn ps.setBlob(7, pages);rn rn ps.executeUpdate();rn ps.addBatch();rn rn ps.executeBatch();rn conn.commit();rn catch (SQLException e) rn e.printStackTrace();rn finally rn close();rn rnrn rnrn[/code] 论坛

没有更多推荐了,返回首页