This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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.
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.
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?
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 ]
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.