aspose file tools*
The moose likes Java in General and the fly likes Equivalent of OracleTypes.CURSOR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Equivalent of OracleTypes.CURSOR" Watch "Equivalent of OracleTypes.CURSOR" New topic
Author

Equivalent of OracleTypes.CURSOR

A Agrawal
Ranch Hand

Joined: Jul 13, 2001
Posts: 41
Can anybody plz tell me what is equivalent of OracleTypes.CURSOR in case of database is SQL Server.

Actually the problem I am facing is, wat to pass as second parameter of registerOutParameter().

cstmt.registerOutParameter(3,OracleTypes.CURSOR);
// where cstmt is callable statement.

we pass OracleTypes.CURSOR when we want to retrieve ResultSet by executing a stored procedure but I am unable to find its equivalent in SQLServer.

I couldn�t locate any thing in java.sql.Types for this purpose.

(I had to import oracle.jdbc.driver.*; to get OracleTypes.CURSOR recognized).

------------------
Amit Agrawal,
New Delhi, India.


Amit Agrawal,<BR>New Delhi, India.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Notice that the Oracle driver was provided by Oracle - NOT Sun. Sun provides the java.sql stuff.
You would need to get the MicroSoft provided driver imported, I would think.


"JavaRanch, where the deer and the Certified play" - David O'Meara
A Agrawal
Ranch Hand

Joined: Jul 13, 2001
Posts: 41
I agree Cindy but that's where I am struck.
Orcale provide very neat classes in its driver with proper names like OracleStatemnet, OracleConnection etc...so one can easily locate such things...
but SQL Server's Driver has classes like a.class, b.class ...up to z.class with many inner classes in each class. So I am unable to locate Oracle's equivalent in SQLServer's driver.
I posted here with the hope somebody must have faced this problem and might have got some solution to it.

------------------
Amit Agrawal,
New Delhi, India.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Apparently you can use ADODB.RecordSet and a cursor is automatically opened. Then you can use the CursorType property to specify whether the cursor is forward-only, static, keyset-driven, or dynamic.
Microsoft has a whole section under SQLServer discussing java implementations.
The cursor discussion is here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlsg/html/msdn_adosql.asp
The whole thing is here: http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28000409
Himanshu Gupta
Greenhorn

Joined: Nov 30, 2001
Posts: 1
Hi,
Even I am facing the same problem.
Did anybody get something substantial on this?
Looking forward for help on this topic?
Thanks in anticipation,
Himanshu
 
jQuery in Action, 2nd edition
 
subject: Equivalent of OracleTypes.CURSOR
 
Similar Threads
Java stored procedures and collections(ORCL)
Oracle 10g JDBC Error
SQL Server 2000 and JDBC,Registering cursor as OUT param
Registering IN OUT parameter
Cursor doubt in callable statement...