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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
Cant connect to oracle.
rewati raman
Ranch Hand
Posts: 62
posted 13 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 13 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 13 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 13 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 13 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
Nothing up my sleeve ... and ... presto! A tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
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...