473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Excution problem

13
Hi!
Sir, First of all i want to thank this site for providing such good information.

coming to problem am facing problem in executing the below program and am gettng the error pasted at bottom after the program....
please help me in this case

if the problem is with setting the path please give me a detailed explanation of setting the path.


import java.sql.*;
import java.lang.*;


public class AviDemo
{
public static void main(String a[]) throws Exception
{
System.out.println("...............Hello.......... ");
try
{
Class.forName("jdbc.oracle.OracleDriver");
Connection con=DriverManager.getConnection("oralce:jdbc:thin: localhost@:1521:xe","system","123");

}catch(Exception e)
{
e.printStackTrace();
}
System.out.println("Connected");

}
}



...............Hello..........
java.lang.ClassNotFoundException: jdbc.oracle.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at AviDemo.main(AviDemo.java:12)
Connected
Aug 31 '07 #1
3 1354
kreagan
153 100+
Hi!
Sir, First of all i want to thank this site for providing such good information.

coming to problem am facing problem in executing the below program and am gettng the error pasted at bottom after the program....
please help me in this case

if the problem is with setting the path please give me a detailed explanation of setting the path.


import java.sql.*;
import java.lang.*;


public class AviDemo
{
public static void main(String a[]) throws Exception
{
System.out.println("...............Hello.......... ");
try
{
Class.forName("jdbc.oracle.OracleDriver");
Connection con=DriverManager.getConnection("oralce:jdbc:thin: localhost@:1521:xe","system","123");

}catch(Exception e)
{
e.printStackTrace();
}
System.out.println("Connected");

}
}



...............Hello..........
java.lang.ClassNotFoundException: jdbc.oracle.OracleDriver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at AviDemo.main(AviDemo.java:12)
Connected
First you have to download the driver. Then you must locate the library file - most likely in the bin directory. The you must have your project recognize to look for that library. You can do this number of ways. When I used eclipse, the IDE had an option where you can select that file. If you don't use an IDE, read section five of the link below.

Path Info
Aug 31 '07 #2
i think the driver name is

oracle.jdbc.driver.OracleDriver


URL is

jdbc:oracle:thin:@localhost:1521
Sep 1 '07 #3
kreagan
153 100+
i think the driver name is

oracle.jdbc.driver.OracleDriver


URL is

jdbc:oracle:thin:@localhost:1521
Yup, that's the driver. The URL is the socket to connect to the database. The errors above are not due to the URL. You need to set the path to read the OracleDriver.

Good luck. Doing it the first time can be tricky.
Setting a Path

The class path should be where that driver is.

In your code, you might need to put an include jdbc.oracle.OracleDriver ... or else jdbc.*

Good luck
Sep 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
4
by: zl2k | last post by:
hi, all If I am using gcc, is the sequence of excution in "if" the same as what I wrote? Here is an example: vector<intv; unsigned short a; ..... if (a < v.size() && v 0) cout<<v;
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.