Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2010, 12:18 PM
Member
 
Join Date: Jan 2010
Posts: 13
Rep Power: 0
ksatty is on a distinguished road
Default Plsql cursor jdbc
Hi
I am working on unit testing ,
I have one issue I have to check that programmer is used cursor or not and also all the cursor that he have used
I have to use jdbc code for.
pls help me as soon as possible
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-11-2010, 12:19 PM
Member
 
Join Date: Jan 2010
Posts: 13
Rep Power: 0
ksatty is on a distinguished road
Default
Thx in advance
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-11-2010, 12:23 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
You can query v$sesstat where name='opened cursors current'.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-11-2010, 01:00 PM
Member
 
Join Date: Jan 2010
Posts: 13
Rep Power: 0
ksatty is on a distinguished road
Default
Thx
I am new to this. pls give me some sample code ?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 01-11-2010, 01:13 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
What code did you try that failed?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 01-11-2010, 02:24 PM
Member
 
Join Date: Jan 2010
Posts: 13
Rep Power: 0
ksatty is on a distinguished road
Default
If I excute above query it is showing


ERROR at line 1:
ORA-00942: table or view does not exist
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 01-11-2010, 02:44 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
You need to be SYS to access those views in the system tablespace.
You should look those up in your oracle documentation. It has nothing to do with Java.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 01-11-2010, 06:48 PM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
If you're planning on trying to check all the cursors have been closed, you won't succeed. Oracle caches some, so you won't be able to tell if there's a leak that way, as far as I know...
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 01-11-2010, 06:56 PM
Senior Member
 
Join Date: Aug 2009
Posts: 1,895
Rep Power: 2
r035198x is on a distinguished road
Default
That's why I didn't suggest that they look in v$open_cursor instead.

They could tell about the leak using these methods if they are very clever and rigorous but the attitude they have shown so far suggests that they will not.

If you want to try it yourself see

Monitoring Open and Cached Cursors | Oracle FAQ
Bookmark Post in Technorati
Reply With Quote
  #10 (permalink)  
Old 01-12-2010, 08:58 AM
Senior Member
 
Join Date: Apr 2009
Posts: 944
Rep Power: 1
Tolls is on a distinguished road
Default
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 lay odds on that being JUnit. This is a hands on check and, arguably, doesn't lend itself to the sorts of things JUnit handles.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
change the mouse cursor - crosshair cursor cassysumandak New To Java 1 09-28-2009 02:57 AM
PLSQL - JAVA Integration ttkong Database 0 04-09-2008 09:31 AM
How to use JDBC Template classes to control basic JDBC processing and error handling Java Tip Java Tips 0 04-01-2008 11:17 AM
Using a cursor notnumber6 New To Java 3 11-26-2007 11:56 PM
How to use JDBC Template classes to control basic JDBC processing and error handling JavaBean Java Tips 0 09-28-2007 01:56 PM


All times are GMT +2. The time now is 07:48 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org