ORA-01000

Unable to resolve error - java.sql.SQLException: ORA-01000: maximum open cursors exceeded

偶尔善良 提交于 2019-12-11 23:54:38
问题 I made a java method to add a row to a database. I am calling this method about 1000 plus times for testing purposes. I called the close() method on my prepared statement and i am still getting the oracle error whenever this method is called to insert a row. Error ORA-01000: maximum open cursors exceeded Source Code public void insertARow(ArrayList<String> row) { try { //Proper SQL statement here, checked by running on DB String insert = "INSERT INTO user.info(cola,colb) values(?,?)"; //Add a

ORA-01000: 超出打开游标的最大数(解决及原因)

帅比萌擦擦* 提交于 2019-11-30 12:14:06
还是 chongqingdaxue 缴费平台 , 税票打印完毕 , 上传到财务处时 , 当税票数目较少时(10几张) , 能正常上传 ; 当数目较大时 ( 共 408 张 ), 就上传失败 . 查看 tomcat 日志 , 如下 : 既然超出最大游标数 , 为了第一间让程序恢复正常运行 , 当然 " 脚疼治脚 " , 先把最大游标数调大 : (1). 以 DBA 登录 PL/SQL (2). 打开 Command Window( 注意不是 SQL Window) (3). 输入以下命令 , 修改 oracle 最大游标数为 1000 SQL> alter system set open_cursors=1000 scope=both; (4). 查看最大游标数是否已修改成功 SQL> show parameter open_cursors; (5). 重启 tomcat( 一定要有这一步 , 否则修改不生效 ) 经过以上操作 , 票据顺利上传上去了 , 可是这样治标不治本 , 万一以后来个 1000 张以上的票据要上传 , 那不就又得改游标数了; 在代码里肯定是每处理一张票就打开一个游标的 , 这样是错误的 . 网上找了这个错误代码的相关说明 , 在 这里 发现以下这段话 这样的错误很容易出现在Java代码中的主要原因是:Java代码在执行conn.createStatement(