• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

eeror in jd bc connectionwith oracle

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Naga,
I got ur email ID from Java ranch .com. Iam facing problem to connect JDBC in Oracle database.
The Code is given below. It is complied with out error . when I try to excute it gives error :
java.lang.ClassNotFoundException: oracle.jdbc.oracle.OracleDriver.
could u tell me how can I fix it.

Code for program:

import java.awt.*;
import java.sql.*;
import java.util.*;
import java.math.*;
import java.awt.event.*;
import java.io.*;


public class MakingAStatement
{
public static void main(String[] args)
{
try
{



Class.forName("oracle.jdbc.oracle.OracleDriver") ;


Connection con = DriverManager.getConnection(
"jdbc racle:thin:@meenuanand1:1521:ed05"
,"scott","tiger");





Statement myStatement = con.createStatement();
ResultSet authorResults = myStatement.executeQuery("select cFirst_Name from registration");
}
catch(ClassNotFoundException cnfe)
{
System.out.println(cnfe);
}
catch(SQLException sqle)
{
System.out.println(sqle);
}
}
}
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic