jdk1.6.0_14 and OracleXE connection problem

Thread Solved

Join Date: Jul 2009
Posts: 11
Reputation: hims4u is an unknown quantity at this point 
Solved Threads: 0
hims4u hims4u is offline Offline
Newbie Poster

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #11
Jul 28th, 2009
well after modifying all the things that u specified in ur previous post,i tried 2 run the program at the command prompt, but the same error repeats again and again. at the run time the code shows the same errors but it compiles successfully. well i hav not tried with netbeans bcoz it is 2 heavy for ma system!!

plzz tell me some method 2 successfully run the program in command prompt only. i shall be thankful 2 u.
Last edited by hims4u; Jul 28th, 2009 at 2:23 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,649
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #12
Jul 28th, 2009
Specify your classpath using backslashes and not forward slashes. Also, it would be better if you first tried this thing out by creating a new folder test and placing your class file along with the JAR file in that directory.
  1. c:\Test>java -cp your-oracle-jar-name.jar YourClassName
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 11
Reputation: hims4u is an unknown quantity at this point 
Solved Threads: 0
hims4u hims4u is offline Offline
Newbie Poster

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #13
Jul 28th, 2009
my classpath was alraedy in back slashes. i tried the test folder and pasted the driver as well as .class file. but when i typed java OracleConnect(name of my file) in command prompt, it still showed the same errors. now tell me what shud i do???
is something wrong wid my code??
plzz solve my problem!!

is dere ne DSN problem?? plzz help me!1
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,649
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #14
Jul 28th, 2009
>java OracleConnect(name of my file)

Read my previous reply; just typing the class name won't do; you have to set the classpath.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 11
Reputation: hims4u is an unknown quantity at this point 
Solved Threads: 0
hims4u hims4u is offline Offline
Newbie Poster

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #15
Jul 28th, 2009
>java OracleConnect(name of my file)
to run the program i did this!!
rest i did the same as u told above!!
that command showed ACCESS DENIED!!!
so i did it manually by pasting the .class file and the ojdbc14.jar in folder test.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,649
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #16
Jul 28th, 2009
C:\Test>java -cp .;ojdbc14.jar OracleConnect
Last edited by ~s.o.s~; Jul 28th, 2009 at 4:43 pm.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,261
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 493
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: jdk1.6.0_14 and OracleXE connection problem

 
-1
  #17
Jul 28th, 2009
This is getting interesting.
  1. import java.sql.Connection;
  2. import java.sql.DriverManager;
  3. import java.sql.SQLException;
  4.  
  5. public class TestDB {
  6.  
  7. public static void main(String args[]) {
  8. Connection con = null;
  9.  
  10. try {
  11. Class.forName("com.mysql.jdbc.Driver").newInstance();
  12. con = DriverManager.getConnection("jdbc:mysql://128.0.0.1:3306/dbName",
  13. "username", "password");
  14.  
  15. if(!con.isClosed())
  16. System.out.println("Successfully connected to " +
  17. "MySQL server using TCP/IP...");
  18.  
  19. } catch(Exception e) {
  20. //System.err.println("Exception: " + e.getMessage());
  21. e.printStackTrace();
  22. } finally {
  23. try {
  24. if(con != null)
  25. con.close();
  26. } catch(SQLException e) {}
  27. }
  28. }
  29. }
While I'm able to run above code, from command line I will receive following stack trace
  1. JAVA.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  2. AT JAVA.net.URLClassLoader$1.run(URLClassLoader.JAVA:200)
  3. AT JAVA.security.AccessController.doPrivileged(Native Method)
  4. AT JAVA.net.URLClassLoader.findClass(URLClassLoader.JAVA:188)
  5. AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:307)
  6. AT sun.misc.Launcher$AppClassLoader.loadClass(Launcher.JAVA:301)
  7. AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:252)
  8. AT JAVA.lang.ClassLoader.loadClassInternal(ClassLoader.JAVA:320)
  9. AT JAVA.lang.Class.forName0(Native Method)
  10. AT JAVA.lang.Class.forName(Class.JAVA:169)
  11. AT TestDB.main(TestDB.JAVA:22)

PS: Java version 1.6.0_12
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,649
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
0
  #18
Jul 29th, 2009
>This is getting interesting.

I don't think so. :-)

Post the entire command you are using as it is.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,261
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 493
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is online now Online
Code tags enforcer

Re: jdk1.6.0_14 and OracleXE connection problem

 
-1
  #19
Jul 29th, 2009
  1. C:\TestDB>javac -cp ojdbc14.jar TestDB.JAVA
  2.  
  3. C:\TestDB>java -cp .;ojdbc14.jar TestDB
  4. JAVA.lang.ClassNotFoundException: com.mysql.jdbc.Driver
  5. AT JAVA.net.URLClassLoader$1.run(URLClassLoader.JAVA:200)
  6. AT JAVA.security.AccessController.doPrivileged(Native Method)
  7. AT JAVA.net.URLClassLoader.findClass(URLClassLoader.JAVA:188)
  8. AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:307)
  9. AT sun.misc.Launcher$AppClassLoader.loadClass(Launcher.JAVA:301)
  10. AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:252)
  11. AT JAVA.lang.ClassLoader.loadClassInternal(ClassLoader.JAVA:320)
  12. AT JAVA.lang.Class.forName0(Native Method)
  13. AT JAVA.lang.Class.forName(Class.JAVA:169)
  14. AT TestDB.main(TestDB.JAVA:22)
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,649
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: jdk1.6.0_14 and OracleXE connection problem

 
1
  #20
Jul 29th, 2009
So, you were expecting a MySQL Driver class in ojdbc14.jar? How about looking for that class in mysql-connector-java.jar file? ;-)
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Oracle Forum


Views: 2474 | Replies: 23
Thread Tools Search this Thread



Tag cloud for Oracle
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC