aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Oracle Ref Cursor  problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Oracle Ref Cursor  problem" Watch "Oracle Ref Cursor  problem" New topic
Author

Oracle Ref Cursor problem

Chris Staten
Ranch Hand

Joined: Sep 24, 2004
Posts: 101
I am doing a project which requires that I use an Oracle Ref Cursor and I am having a problem because I can�t import oracle.jdbc.driver.*. I have my classpath set to point at my classes12.zip file, but when I try to import oracle.jdbc.driver.* I get
�the import oracle cannot be resolved�
.

My IDE is WSAD and I have j2ee 1.4 and j2se 1.5 installed.

Am I missing something?
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
Originally posted by Chris Staten:
I have my classpath set to point at my classes12.zip file, but when I try to import oracle.jdbc.driver.* I get .

Am I missing something?


Check whether your class path has any typographial errors.
Normally in Unix flavours "$" & ":" are used & in windows "%" & ";" are used check these .


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

Chris,
Which classpath is set? Double check that it is the project classpath (right click the project, properties, build path.) Also, I think you need to point to the classes12.jar (instead of zip) for WSAD to pick it up.

Also note that WSAD doesn't yet support java 1.5.

This is definitely a classpath/IDE issue, so I'm moving to our IDEs forum.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Chris Staten
Ranch Hand

Joined: Sep 24, 2004
Posts: 101
OK, I�ve moved Oracle�s classes12.jar into my project. I can now import oracle.jdbc.driver.* without getting the ��import oracle cannot be resolved� error. Now I can�t seem to use the OracleTypes.class file. I get almost the same error as before, now it says �OracleTypes cannot be resolved or is not a type�, and I can see that the class is there (oracle.jdbc.driver.OracleTypes). Here is the code that is broken:



The line with cstmt.registerOutParameter(1, OracleTypes.CURSOR); is giving me the �OracleTypes cannot be resolved or is not a type� error.

Also, here is the class that I am dealing with in the classes12 package:
oracle.jdbc.driver.OracleTypes.class � It looks like this extends oracle.jdbc.internal.OracleTypes.class, which is an abstract class that extends another abstract class oracle.jdbc.OracleTypes.class. I can click on the abstract class in oracle.jdbc.OracleTypes.class and bring it up in WSAD to see that the value of OracleTypes.CURSOR is set to -10.

I obviously seem to be messing something up in my code, but what?

-Thanks.


Edit: This may need to be moved back out of the IDE forum now that I can import the class, but I don't know and I'm to confused to think that hard :\ .
[ January 18, 2005: Message edited by: Chris Staten ]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

Chris,
Try using "OpenType" (on the navigation menu) to see where WSAD thinks OracleTypes is. You want to make sure it WSAD picks up on the fact that it is in classes12.jar.

Another possibility is that there are two OracleTypes classes in your imports. Try adding:
import oracle.jdbc.driver.OracleTypes;

It's still an IDEs/classpath issue since WSAD can't find OracleTypes. Once the compilation issues get resolved, please post a new thread in JDBC if you have a JDBC question. This one should stay in IDEs to help people in the future.

Thanks,
Jeanne
JDBC/IDEs Forum Bartender
 
wood burning stoves
 
subject: Oracle Ref Cursor problem