| | |
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
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.
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.
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.
Oracle Syntax (Toggle Plain Text)
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
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
•
•
Join Date: Jul 2009
Posts: 11
Reputation:
Solved Threads: 0
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
is something wrong wid my code??
plzz solve my problem!!
is dere ne DSN problem?? plzz help me!1
>java OracleConnect(name of my file)
Read my previous reply; just typing the class name won't do; you have to set the classpath.
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
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
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
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
This is getting interesting.
While I'm able to run above code, from command line I will receive following stack trace
PS: Java version 1.6.0_12
Java Syntax (Toggle Plain Text)
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class TestDB { public static void main(String args[]) { Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con = DriverManager.getConnection("jdbc:mysql://128.0.0.1:3306/dbName", "username", "password"); if(!con.isClosed()) System.out.println("Successfully connected to " + "MySQL server using TCP/IP..."); } catch(Exception e) { //System.err.println("Exception: " + e.getMessage()); e.printStackTrace(); } finally { try { if(con != null) con.close(); } catch(SQLException e) {} } } }
Oracle Syntax (Toggle Plain Text)
JAVA.lang.ClassNotFoundException: com.mysql.jdbc.Driver AT JAVA.net.URLClassLoader$1.run(URLClassLoader.JAVA:200) AT JAVA.security.AccessController.doPrivileged(Native Method) AT JAVA.net.URLClassLoader.findClass(URLClassLoader.JAVA:188) AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:307) AT sun.misc.Launcher$AppClassLoader.loadClass(Launcher.JAVA:301) AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:252) AT JAVA.lang.ClassLoader.loadClassInternal(ClassLoader.JAVA:320) AT JAVA.lang.Class.forName0(Native Method) AT JAVA.lang.Class.forName(Class.JAVA:169) 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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
>This is getting interesting.
I don't think so. :-)
Post the entire command you are using as it is.
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
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
Oracle Syntax (Toggle Plain Text)
C:\TestDB>javac -cp ojdbc14.jar TestDB.JAVA C:\TestDB>java -cp .;ojdbc14.jar TestDB JAVA.lang.ClassNotFoundException: com.mysql.jdbc.Driver AT JAVA.net.URLClassLoader$1.run(URLClassLoader.JAVA:200) AT JAVA.security.AccessController.doPrivileged(Native Method) AT JAVA.net.URLClassLoader.findClass(URLClassLoader.JAVA:188) AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:307) AT sun.misc.Launcher$AppClassLoader.loadClass(Launcher.JAVA:301) AT JAVA.lang.ClassLoader.loadClass(ClassLoader.JAVA:252) AT JAVA.lang.ClassLoader.loadClassInternal(ClassLoader.JAVA:320) AT JAVA.lang.Class.forName0(Native Method) AT JAVA.lang.Class.forName(Class.JAVA:169) 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
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
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
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
![]() |
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: 2474 | 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






