| | |
jdk1.6.0_14 and OracleXE connection problem
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Jul 2009
Posts: 11
Reputation:
Solved Threads: 0
hello exprts!! i am new 2 database!!! i have oracleXE and jdk 1.6.0_14 installed on windows XP!! i want 2 connect them via my java program.but i am gettting errors after executing the program.
my code is:
i get the following error:
ERROR : java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at OracleConnect.main(OracleConnect.java:11)
plzz tell me how to solve this problem!!!
my code is:
java Syntax (Toggle Plain Text)
import java.sql.*; //import oracle.jdbc.*; //import oracle.jdbc.OracleDriver; public class OracleConnect { public static void main(String[] args)throws SQLException { try { Class.forName("oracle.jdbc.OracleDriver"); //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@HOST:1521:XE","hr","hr"); if(conn != null) { System.out.println("I am Connected to oracle database"); } conn.close(); } catch (Exception e) { System.out.println("ERROR : " + e); e.printStackTrace(System.out); } } }
ERROR : java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at OracleConnect.main(OracleConnect.java:11)
plzz tell me how to solve this problem!!!
Last edited by peter_budo; Jul 26th, 2009 at 7:39 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
There is no need for expert. The error spell it out clearly for you
You either do not have connection drivers at all or you did not let application know where to find this driver (either add it through IDE or on compile provide classpath with location of this driver). To download go here
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Jul 2009
Posts: 11
Reputation:
Solved Threads: 0
thanxx for replying but i hav alraedy specified the classpath!!
i hav driver named ojdbc14.jar and ojdbc14_g.jar in E:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib and my classpath is::
E:/oraclexe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar;E:\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Teleca Shared;E:\java\bin
now plzz tell me is the classpath correct???
regarding the drivers plzz specify where shud i find them!!!
i hav them already in /lib as told above!!
plzz reply what shud i do now!!
w8in for ur reply!!
i hav driver named ojdbc14.jar and ojdbc14_g.jar in E:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib and my classpath is::
E:/oraclexe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar;E:\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Common Files\Teleca Shared;E:\java\bin
now plzz tell me is the classpath correct???
regarding the drivers plzz specify where shud i find them!!!
i hav them already in /lib as told above!!
plzz reply what shud i do now!!
w8in for ur reply!!
- No need to shout with explanation marks, that will not get you faster respond
- This is not necessary
E:/oraclexe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar - ojdbc14.jar or ojdbc14_g.jar will not help you as documentation clearly state "classes for use with JDK 1.4 and 1.5"
- Therefore you either need to use lower JDK or get Oracle 11g and download ojdbc6.jar (Classes for use with JDK 1.6.)
Have nice day.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Few things you can try
- If you insisting on using classpath then you should use following declaration
E:\Coraclexe\app\oracle\product\10.2.0\server\jdbc\lib - On other hand you can direct your IDE where to look for connector, importing JAR for Eclipse here and NetBeans and IntelliJ IDEA here
- Also check your connection string if @HOST should not be replaced by @localhost, but this is not related to class not found error
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Similar Threads
- AOL/router connection problem with msn messenger (Networking Hardware Configuration)
- Vista and Connection Problem (Windows Vista and Windows 7)
- Yes. Yet another connection problem. (Viruses, Spyware and other Nasties)
- A7N8X-X MCP LAN Connection Problem (Windows NT / 2000 / XP)
- Internet Connection problem:Cable to modem to router to PC (Networking Hardware Configuration)
- Internet connection problem (Windows NT / 2000 / XP)
- Connection Problems (Networking Hardware Configuration)
Other Threads in the Oracle Forum
- Previous Thread: files of tables
- Next Thread: vista DSN name oracle odbc driver missing
Views: 2501 | Replies: 23
| Thread Tools | Search this Thread |
Tag cloud for Oracle
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware erp federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho






