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
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:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
JDBC and Relational Databases
java oracle conectivity
rewati raman
Ranch Hand
Posts: 62
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi I need to write a program to connect to oracle to enter a row into the table.
here is my code.
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();} } }
i am getting this error.
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.
Christophe Verré
Sheriff
Posts: 14691
16
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
PatienceIsAVirtue
. Do not duplicate threads. Continue the discussion
there
.
[My Blog]
All roads lead to JavaRanch
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Getting an Exception wile accessing data
Connecting to an Oracle DB
Problem with loading driver
oracle.jdbc.driver.OracleDriver
Problem with com.mysql.jdbc.Driver driver
More...