I'm using the following code
st = connection.createStatement(
ResultSet.CONCUR_READ_ONLY,
ResultSet.FETCH_FORWARD,
ResultSet.TYPE_FORWARD_ONLY
);
st.setFetchSize(1000);
...
|
Is there a way to ask the API for a list of open cursors (or at least a count of the number of currently open cursors) ?
|
Is there a way in JDBC to find out the cursor opened or not in JAVA.
We are getting an exception when tried to access an un opened cursor.
java.sql.SQLException: Cursor is closed.
Here ... |
I have java application that process such kind of data:
class MyData
{
Date date;
double one;
double two;
...
|
When using cursors in BerkleyDB JE I found that traversing a dataset generate a lot of random read IO. It happens because BDB traverse dataset in primary key ascending order.
In my ... |
I am using JDBC to connect my jython to a heterogeneous set of databases.
Using a cursor I get the rows in list form, and the cursor
also knows the metadata (cursor.description).
Usually you ... |
Hi all, I'm facing a strange problem in my java application. I'm connecting to Oracle database using jdbcodbc driver. My application consists of swing GUI . It populates a number GUI elements like JList/Jcombo.... in a number of panels using the data retrieved from oracle db. It again uses the parameters selected by the user to generate various reports/graphs.(this again requires ... |
|
|
Please see following example which I borrow now from one of my previous assignments: import java.sql.*; import java.io.*; import oracle.jdbc.driver.*; public class retrefcur_samp { public static void main (String args []) // throws SQLException { try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); connection URL. Connection conn = DriverManager.getConnection ("jdbcracle:thin:@pavilion03:1529ra8i", "you", "me"); init (conn); CallableStatement call = conn.prepareCall ("{ ? = call java_refcursor.job_listing (?)}"); call.registerOutParameter ... |
|
hi I am having this problem of getting an error message max cursors open. i have a couple of doubts in this : 1. are database connection (java.sql.Connection class) they also called cursors. can this error come if i dont close my connections properly ?? 2. how many connections will be opened by following type of code ? can this be ... |
|
|
|
I am attempting to write a paginated results class, which will allow a web user to make paginated queries to the preparedCall and return a OracleTypes.CURSOR object. The user session would then store the current position and only retrieve results associated with the current page using the absolute function. This is basic stuff, I know, but I cant find out how ... |
Hi! I have a java app that is in use by our users. For some reason, that I have not been able to figure out, every once in a while, they will get a java.sql.exception Cursor C1 Already Open error message. The first place it started happening was in Order Maintenance. They would key an order number, and if it was ... |
Hello All, I would really appreciate if you could clarify these doubts on index, cursors by EOD. 1. What are different Types of Indexes: 2. What type of index by default is being for a primary key and unique key? 3. What are different types of cursors and explain them? Thank you Saritha |
Hi ! I have a problem with MAX Open Cursors ! My requirement is like this, i need to query 50,000 odd records from one database and then query depending on primary key to the same table in another database. If the data exists in db2 then i need to update else i need to insert the record from db1 into ... |
|
|
|
Hi Sunil Thanks for you response. But im using SQLServer ..i need to know how to solve this when using SQLServer. As im not able to find the Driver Documentation (Microsoft JDBC Driver for SQLServer).Please let me know where can i find the API for this driver. Please any one help me reg this issue.Its very urgent |
|
Got a weird question about an error our customer getting in an application we wrote when it is run against Oracle 10g. We had a Java Stored Procedure that was reading in a file and then dumping the data after parsing into Oracle 9i. The system in question has been updated to 10g and is suddenly giving us an error that ... |
I'm getting one SQLException When I execute one query which try to open one oracle cursor. My jdk version is 1.4.2_08 and oracle version is 10g Enterprise Edition Release 10.1.0.4.0. And I use ojdbc14_g.jar and orai18n in CLASSPATH. My code and my table is very simple: CallableStatement cs = myConn.prepareCall( "begin open ? for select * from hello; end;" ); cs.registerOutParameter(1, ... |
While we did one implementation I would get this exception : scenario was we were reading line by line from a file and would insert records into the database The file could run into thousands of records . so for each line in file was inserting a record in the database suddenly in the middle of the run - it would ... |
I am using resin2.1.x connection pooling and oracle9i, i want to know is it possible to remove a certain connection from the pool manually. Infact i will observer if a certain connection is using more than 100 cursors, then just remove that connection pool, and get some new. it will be use ful to prevent MAX OPEN CURSOR EXCEEDED, i am ... |
Hi All - (Sorry Sachin - I don't mean to hijack your question, but I didn't want to post the same exact issue in another thread). I am having the same problem, and the solution below does not help. Nor does any other solution I can find... Here is my code - it happens after less than 100 record insertions. insapp ... |
Hello there! I have a query that returns a large amount of data (please don't throw any rocks at me, I really have some reasons for this query although I do not agree with them). The query is very simple: SELECT email from USERS; single column, indexed on Oracle 10g. Problem is: 1.98 million results. Well, running this query using a ... |
Hi all Ranchers I m facing a very peculiar problem in my application We take connection object fro the connection pool Do the processings:: Open resultSet Fire queries But the resultset is kept open AND WE HAVE RETURNED THE CONNECTION TO THE POOL Now the problem is that it ius not possible for us to pit rs.close() Secondly there are Cursors ... |
Hello everyone, I am using Stored procedures heavily my application. What I could find out is that implicit cursors opened by stored procedures are kept open, even after we close the connection and statment. So whenever a procedure is called, the statments opened are left open in Session in Oracle. This is leading to SQLException because database is having a maximum ... |
Hi, This is an ORACLE SQL question, rather than a JDBC question. Suppose i have a table 'Table1' with the following records: Fund :Col2: SeqNo: Col4 ======================== 1 1 1 x 1 1 2 y 2 1 5 y 2 1 6 x 1 0 3 p 2 0 4 y The Query that would return this resultset in the order ... |
|
Hello, I receive the following error : java.sql.SQLException: Cursor state not valid. here is my code : String sql_query = "INSERT INTO TABELA(CAMPO1, CAMPO2, CAMPO3) VALUES ( ? ? , ? )"; try { Class.forName(driver); Connection connection = DriverManager.getConnection(URL); PreparedStatement prepared_statement = connection.prepareStatement(sql_query); int i ; for(i = 0; i < 10; i++) { String u = (String)ptabela.getValueAt(i, 0); String uu ... |
|
|
|
Hello Everyone, I have a function which takes Cursor as IN Parameter... Please someone help me "How I can pass Cursor as In parameter"... Whether it will take Array as inparameter or any otherthing FUNCTION MSTFUPRF ( pi_acnt_id IN ACCOUNTS.ACNT_ID%TYPE, IN parameter of Number type, Pass ACNT_ID pi_ugrp_id IN USAGE_GROUPS.UGRP_ID%TYPE, IN parameter of Number type, pass UGRP_ID pi_uprf IN trc_uprf ... |
statement5=connection.prepareStatement("insert into TRANSDETAIL(TRANSNO,ITEMCODE,SERIALNUMBER,MOBILENUMBER,INVOICENO) values(?,?,?,?,?)"); statement6=connection.prepareStatement("insert into CHANNELINVENTORY(ITEMCODE,SERIALNUMBER,MOBILENUMBER,CHANNELCODE,CURRENTSTATUS,LASTUPDATEON,CIRCLEID) values(?,?,?,?,?,sysdate,?)"); for(int i=0;i 0 && i % 1000 == 0){ statement5.executeBatch(); statement5.addBatch(); statement5.clearParameters(); }else{ statement5.addBatch(); statement5.clearParameters(); } // statement5.addBatch(); statement6.setString(1,primaryForm.getItemCode()); statement6.setString(2,primaryForm.getSerialNumber()); statement6.setString(3,primaryForm.getMsisdn()); statement6.setString(4,primaryForm.getDistributorCode()); statement6.setString(5,"UN"); statement6.setString(6,circleId); //statement6.executeUpdate(); if (i > 0 && i % 1000 == 0){ statement6.addBatch(); statement6.clearParameters(); statement6.executeBatch(); }else{ ... |
Hello, A few months back we faced an issue where in the stack trace we saw an exception specifying the maximumm number of cursors are exceeded I do understand why this exception is caused ( not closing prepared statement ) Have since rectified the issue. My query is - after we get the exception : 1 >At what point are the ... |
|
42. cursor? coderanch.comThis is a continued question for this thread thread I am trying to create a function not a procedure that returns cursor. I have tried this but get compiler errors FUNCTION results( a number ) return SYS_REFCURSOR as cursor mycursor return TESTTABLE%T1 is select * from TESTTABLE ; BEGIN open mycursor ; -- for select * from TESTTABLE ; return mycursor ... |
Good article, but it does (sort of) agree with what I said about it being not really doable (at least as an automated thing). I did, however, get my terminology wrong. I thought it was down to the cacheing, but it's simply down to Oracle not closing cursors straight away. I say automated, since they're talking about unit testing...and I would ... |