• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Hello

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

This is my error iam not getting any output iam getting this java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver .even i set class path also .i am getting this java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver ..what to do with this.can any one slove this please.this is my program..


import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;




public class getting extends HttpServlet
{
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException
{
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
Connection con = null;
String url="jdbc racle:thin:@localhost:1521 atab";
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
con=DriverManager.getConnection(url,"scott","tiger");
PreparedStatement pst=con.prepareStatement("Select * from empsal");
ResultSet rs=pst.executeQuery();
ResultSetMetaData rsmd=rs.getMetaData();
int no=rsmd.getColumnCount();
pw.println(+no);
pw.println("The name of the columns are:
");
for(int i=0;i<=no;i++)
{
String s=rsmd.getColumnName(i);
pw.println(s);
}
}
catch(Exception e)
{
pw.println(e);
}

}
}

mahendranag@gmail.com
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
> Hello.
Hello. How are you doing?

> .i am getting this java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Sounds like it could not find the class OracleDriver. It has to be in one of the jars in your class path.
It could be one of these Find Jar for OracleDriver
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A long time ago, Oracle distributed the driver in a file named classes12.zip.

You shouldn't be using that one, since it changed in Oracle 9, and Oracle 8 is no longer supported that I know of.

However, the classpath jars have to have names ending in ".jar", so the classes12.zip had to be renamed.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch. Please use a meaningful subject line when you post a question.
 
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic