Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
paul wheaton
Jeanne Boyarsky
Ron McLeod
Sheriffs:
Paul Clapham
Liutauras Vilda
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
JDBC and Relational Databases
Cant connect to oracle.
rewati raman
Ranch Hand
Posts: 62
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
i made this program. its compileing without error. but it giving error when i am running it.
import java.io.*; import java.sql.*; public class data { public static void main(String[] args) { try { Connection con=null; Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection( "jdbc:oracle:thin:@localhost:1521:ORCL", "rew", "happy"); Statement s=con.createStatement(); s.execute("INSERT INTO account VALUES ('soujanya', 'chichula', f,'sj@gmail.com')"); s.close(); con.close(); } catch(Exception e){e.printStackTrace();} } }
this is the error i am getting
java data Exception in thread "main" java.lang.NoClassDefFoundError: data Caused by: java.lang.ClassNotFoundException: data at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334) Could not find the main class: data. Program will exit.
rewati raman
Ranch Hand
Posts: 62
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
its still not working
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
rewati raman wrote:
its still not working
This is not going to help you.
PatienceIsAVirtue
.
[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
1. Follow the code conventions and rename your class with a capital letter (something like Data.java)
2. Is this class in your classpath ? If not, try to execute it with "java -cp . Data"
[My Blog]
All roads lead to JavaRanch
rewati raman
Ranch Hand
Posts: 62
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
i was able to resolve it but i got another error. i posted it on new
thread
thanks
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
jdbc
JDBC/ODBC classnot found exception
JDBC/ODBC class not found exception
java oracle conectivity
oracle.jdbc.driver.OracleDriver
More...