Import Oracle Jdbc Oracletypes Error
Contents |
Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: JDBC and Relational Databases
Oracletypes Is Not Public In Oracle.jdbc.driver; Cannot Be Accessed From Outside Package
OracleTypes error while Migrating app in Java 6 with Weblogic oracle.jdbc.oracletypes jar 10.3.4 server Dhanaji Patil Greenhorn Posts: 8 posted 5 years ago Hi, We have an application oracle.jdbc.oracletypes maven that is running fine in production with java version 1.5 and weblogic server 9.2.0. Now we are migrating the same application to Java version 6 and weblogic
Oracle.jdbc.oracletypes Jar Maven
server 10.3.4. We have integrated our application using eclipse IDE and its working fine. But when I am trying to build the ear using ant script, I am getting below error - [javac] C:/Build XML_10.3.4/src/com/dao/ApplyDAO.java:21: cannot access oracle.jdbc.OracleTypes [javac] bad class file: C:\Build XML_10.3.4\ojdbc6.jar(oracle/jdbc/OracleTypes.class) [javac] class file has wrong version 50.0, should be 49.0 [javac]
Oraclepreparedstatement Is Not Public In Oracle.jdbc.driver; Cannot Be Accessed From Outside Package
Please remove or make sure it appears in the correct subdirectory of the classpath. [javac] import oracle.jdbc.OracleTypes; [javac] ^ [javac] 1 error I have tried running the build by setting the ojdbc6.jar(copied from the weblogic 10.3.4 server\lib installation folder) or classes111.jar in classpath. Could anyone please assist me in finding out whats went wrong? Will appreciate the help... Fatih Keles Ranch Hand Posts: 182 posted 5 years ago Hi Dhanaji, I am not an expert about ant scripting but it seems to me that your ant script is using and expecting java 1.5 but your driver jar is for 1.6. You should define the correct javac used by your ant script. Dhanaji Patil Greenhorn Posts: 8 posted 5 years ago Thanks for your help Fatih. I had forgotten to change the version. Now I changed it to java 1.6 and now its giving me different error: [javac] C:\Build XML_10.3.4\src\com\dao\ApplyDAO.java:27:oracle.jdbc.driver.OracleTypes is not public in oracle.jdbc.driver; cannot be accessed from outside package
was
Oracle.jdbc Jar
type oracle.jdbc.driver.OracleTypes is not visible .After doing hours of research looks like the WAS 7 uses oracle 11g driver. In ojdbc14.jar the visibility of OracleTypes is public the https://coderanch.com/t/532840/JDBC/databases/OracleTypes-error-Migrating-app-Java visibility of the OracleTypes class in ojdbc6.jar is changed to default so you can use it. We had to change to oracle.jdbc.OracleTypes from oracle.jdbc.driver.OracleTypes to make the application work. Posted by gops at 10:40 AM http://willcodejavaforfood.blogspot.com/2010/06/type-oraclejdbcdriveroracletypes-is-not.html 3 comments: JSR 168 PortletsMarch 1, 2011 at 5:49 AMHiAfter replacing from oracle.jdbc.driver.OracleTypes to oracle.jdbc.OracleTypes for ojdbc14.jar it is working fine. when i will use ojdbc6.jar, then shall i use oracle.jdbc.OracleTypes or oracle.jdbc.driver.OracleTypes?ReplyDeletesouad MaDecember 1, 2012 at 4:26 PMthank youuuuuuuuuuuuuuuuuuuuuuuuuReplyDeleteharikumar mavalurNovember 12, 2013 at 12:25 PMAwesome and Useful post ReplyDeleteAdd commentLoad more... Newer Post Older Post Home Subscribe to: Post Comments (Atom) Followers Blog Archive ▼ 2010 (7) ► November (2) ▼ June (3) RAD publishing problem and corba errors less no of database connections and Multithreading... The type oracle.jdbc.driver.OracleTypes is not vis... ► April (2) About Me gops View my complete profile
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full https://www.experts-exchange.com/questions/24972429/cannot-access-oracle-jdbc-OracleTypes-class-file-has-wrong-version-50-0-should-be-49-0-wlcompile.html Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > cannot access http://www.dbasupport.com/forums/showthread.php?43580-Error-quot-package-oracle-jdbc-does-not-exist-quot oracle.jdbc.OracleTypes : "class file has wrong version 50.0, should be 49.0" wlcompile Want to Advertise Here? Solved cannot access oracle.jdbc.OracleTypes : "class file has wrong version 50.0, should be 49.0" wlcompile Posted cannot be on 2009-12-11 Java App Servers Java EE 1 Verified Solution 3 Comments 2,352 Views Last Modified: 2013-12-10 I am using Eclipse to develop. I have a BEA/Oracle 10g server configured. I have a version of the code in a different workspace which is on a different branch, which I can build and deploy/run just fine. In working a production issue, I got the latest code into is not public a new workspace, reconfigured the workspace to match the branch workspace, but am running into a strange error when building: [wlcompile] \enterprise\latest\source\WebmedxEJB\webmedx\db\BindValue.java:11: cannot access oracle.jdbc.OracleTypes [wlcompile] bad class file: C:\bea10g\wlserver_10.3\server\lib\ojdbc6.jar(oracle/jdbc/OracleTypes.class) [wlcompile] class file has wrong version 50.0, should be 49.0 [wlcompile] Please remove or make sure it appears in the correct subdirectory of the classpath. [wlcompile] import oracle.jdbc.OracleTypes; I am not sure how or why this error could even occur in one project/workspace and not the other. It would appear that perhaps the version of ojdbc6.jar is newer than what the compiler is expecting, but how would I even go about finding the older replacement? (And why wouldn't this happen in the other workspace, which is nearly identical except for source file location?) 0 Question by:alexxandra Facebook Twitter LinkedIn Google LVL 5 Best Solution byblackfrancis75 Yes, this means that the code was compiled with a later version of the JDK than you're trying to run it on. In your Eclipse settings, you're able to configure workspace-default and project-specific compiler Go to Solution 3 Comments LVL 40 Overall: Level 40 Java EE 14 Java App Servers 4 Message Expert Comment by:gurvinder3722009-12-12 try the following http://answers.yahoo.com/question/
oracle.jdbc does not exist" If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: Error: "package oracle.jdbc does not exist" Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 06-28-2004,08:45 PM #1 tryston02 View Profile View Forum Posts Junior Member Join Date Jun 2004 Posts 2 Error: "package oracle.jdbc does not exist" Hello, I'm trying to write a simple Java example that pulls from an Oracle Database, however, I keep getting this error when I try to compile it. ----------------------------------------------------------------- Test/FirstExample.java [22:1] package oracle.jdbc does not exist Class.forName(oracle.jdbc.driver.OracleDriver); ^ 1 error Errors compiling FirstExample. ----------------------------------------------------------------- Here's what my classpath is set to: CLASSPATH=.;D:\Oracle\ora92\jdbc\lib\ojdbc14.jar;D:\Oracle\ora92\jdbc\lib\ocrs12.zip Here's what my path is set to: PATH=D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\j2sdk1.4.2_04\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\Syst em32\Wbem Here's what my Java_home is set to: JAVA_HOME=C:\j2sdk1.4.2_04 Here's what my oracle_home is set to: ORACLE_HOME=D:\Oracle\ora92 I'm using the 1.4.2 Java SDK and I'm running the Oracle Server on the same box that I'm developing on (no Oracle client is installed) Here is my code: ------------------------------------------------------------------------ package Test; import java.sql.*; public class FirstExample { public static void main(String[] args){ //declare Connection and Statement Objects Connection myConnection = null; Statement myStatement = null; try{ //register the Oracle JDBC drivers Class.forName(oracle.jdbc.driver.OracleDriver); //create a connection object, and connect to the database as system //using the oracle JDBC Thin driver myConnection = DriverManager.getConnection("jdbc:oracle:thin@dev:1521:ORACLASS", "system", "password"); //create a statement object myStatement = myConnection.createStatement(); ResultSet myResultSet = myStatement.executeQuery("SELECT user, sysdate " + "FROM dual"); ...deleted rest of script ----------------------------------------------------------------------------- I know that package exists on my computer because I can find it in windows explorer. I also notic